Help - Search - Member List - Calendar
Full Version: Order of execution of perl
WorkTheWeb Forums > Webmaster Resources > Perl Beginner Help
Support our Sponsors!
S K
Hi I have a script as follows:
--------------------------------------------
#!/bin/perl -w
sub myOne {
my($concept, $opinion) = @_ ;
print "$concept " ;
print "$opinion " ;

}

&myOne( "hello", "myviews....." );
system("/bin/date");
--------------------------------------------

When I run it I get the following output

delta{/home/dlt/SCRIPTING/perl/2}1064>./subRoutine.pl
Tue Jul 12 17:45:38 PDT 2005
hello myviews..... delta{/home/dlt/SCRIPTING/perl/2}1065>

---
Since I am calling the subroutine first...shouldn't the output
generated from the subroutine appear first ?

delta

Randal L. Schwartz
QUOTE
"S" == S K <[Email Removed]> writes:

S> Since I am calling the subroutine first...shouldn't the output
S> generated from the subroutine appear first ?

<http://perl.plover.com/FAQs/Buffering.html>

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +
<[Email Removed]> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


PHP Help | Linux Help | Web Hosting | Reseller Hosting | SSL Hosting
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2006 Invision Power Services, Inc.