This doesn't seem to work... My webhost is running PERL 5.004_04
I tried just the following test.pl

#!/usr/local/bin/perl -w
use strict;

  my @body;

  $body[0] = "Test Data:\n";
  $body[1] = "foo\n";
  $body[2] = "I should be below bar\n";

  s/foo/bar/ for @body;

  print @body;

and I get

syntax error at ./test.pl line 10, near "s/foo/bar/ for "
Execution of ./test.pl aborted due to compilation errors.

Thoughts?

Sheridan Saint-Michel



----- Original Message -----
From: "Randal L. Schwartz" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; "Robert Hanson" <[EMAIL PROTECTED]>;
"Lysander" <[EMAIL PROTECTED]>
Sent: Monday, February 04, 2002 12:28 PM
Subject: Re: Using =~ with a list
[snip]
> This works:
>
>         s/foo/bar/ for @body;
>
> presuming you have a reasonably modern Perl.


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

Reply via email to