>>>>> "Eric" == Eric Wang <[EMAIL PROTECTED]> writes:

    Eric> newbie question: what's the equivalent of /* */ as in C++ in
    Eric> PERL??

There isn't one.  Some people might disagree, but hear me out.  :-)

There are two ways of doing something similar, but not identical.  
The first, and one you're most likely to use is '#', for example:

   print $bar unless @foo > 2; # print $bar unless @foo has more than
                               # two elements.

However, this isn't /**/.  It only works to the end of the current line.

The second, which is more equivalent to /**/, is '=cut'.  It's part of
Perl's documentation format, POD, which you can read about in 'perldoc
perlpod'.  It isn't entirely like /**/, in that you have to put it
at the start of a new statement.

It's used like this:

   print 1..3;

   =cut
   print 4..6;
   =cut

   print 7..9;

(prints '123789')

Hope this helps,

- Chris.
-- 
$a="printf.net"; Chris Ball | chris@void.$a | www.$a | finger: chris@$a
 chris@lexis:~$ perl -le'@a=($^O eq 'darwin')?qw(100453 81289 9159):qw
 (23152 19246 2040);while(<>){chomp;push @b,$_ if grep {$.==$_}@a}push
 @b,$^X;print ucfirst join(" ",@b[2,0,3,1]).","'</usr/share/dict/words


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to