[23299] in Perl-Users-Digest
Perl-Users Digest, Issue: 5519 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Sep 18 00:06:01 2003
Date: Wed, 17 Sep 2003 21:05:10 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Wed, 17 Sep 2003 Volume: 10 Number: 5519
Today's topics:
@_ in subroutine corrupts data? <synthespian@uol.com.br>
Re: @_ in subroutine corrupts data? <ramen@lackingtalent.com>
Re: @_ in subroutine corrupts data? <sholden@staff.cs.usyd.edu.au>
Re: @_ in subroutine corrupts data? <rubyguru@hotmail.com>
Re: @_ in subroutine corrupts data? <synthespian@uol.com.br>
Automate Perl module (Teresa Jeremy)
Re: Automate Perl module <bwalton@rochester.rr.com>
Compiling Curses in OS X for Perl <piercer@nospam_pacbell.net>
Re: current path <jurgenex@hotmail.com>
Re: Database Record into a hash... <cs@edu.edu>
DBI.pm fetchrow() issue <darius_fatakia@yahoo.com>
Re: DBI.pm fetchrow() issue <drumspoorly@reachone.net>
Re: DBI.pm fetchrow() issue <bwalton@rochester.rr.com>
Re: Forking Server <jgibson@mail.arc.nasa.gov>
Re: How do I change my directory back? <emschwar@pobox.com>
Re: How do I change my directory back? (Tad McClellan)
I know I can do this with a regex, but... <nerdy1@snet.net>
Re: locatime() <dha@panix.com>
package problem? [was Re: @_ in subroutine corrupts dat <synthespian@uol.com.br>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 17 Sep 2003 23:28:39 -0300
From: synthespian <synthespian@uol.com.br>
Subject: @_ in subroutine corrupts data?
Message-Id: <bkb5d9$p90ge$1@ID-78052.news.uni-berlin.de>
hello --
I can find no reasonable explanation for this behavior. Not theat
there's isn't one (a trivial one at that), but I am having a hard time
finding the reason for this:
#!/usr/bin/perl
@array = subthis(1, 2, 3, 4);
sub subthis {
@array = @_;
foreach (@array) {
print "$array[$_]\n";
}
return (@array);
}
print "Finished\n";
$ perl subrout2.pl
2
3
4
Finished
Whatever happened to the "1"?
Is this behavior to be expected? Why?
I get the same response in Perl 5.6 and 5.8
TIA
Henry
------------------------------
Date: Thu, 18 Sep 2003 02:45:23 -0000
From: Dave Benjamin <ramen@lackingtalent.com>
Subject: Re: @_ in subroutine corrupts data?
Message-Id: <slrnbmi7bu.ong.ramen@lackingtalent.com>
In article <bkb5d9$p90ge$1@ID-78052.news.uni-berlin.de>, synthespian wrote:
> I can find no reasonable explanation for this behavior. Not theat
> there's isn't one (a trivial one at that), but I am having a hard time
> finding the reason for this:
>
> #!/usr/bin/perl
>
> @array = subthis(1, 2, 3, 4);
>
> sub subthis {
>
> @array = @_;
> foreach (@array) {
> print "$array[$_]\n";
> }
> return (@array);
> }
>
> print "Finished\n";
>
> $ perl subrout2.pl
> 2
> 3
> 4
>
> Finished
>
> Whatever happened to the "1"?
You are looping through the values in @array, and then indexing the array
based on those values. In other words, this is what you're printing:
$array[1]
$array[2]
$array[3]
$array[4]
Since arrays are 0-indexed, you are getting three values and an undefined
fourth value. I think what you meant to say was:
print "$_\n";
Instead of:
print "$array[$_]\n";
Dave
--
.:[ dave benjamin (ramenboy) -:- www.ramenfest.com -:- www.3dex.com ]:.
: d r i n k i n g l i f e o u t o f t h e c o n t a i n e r :
------------------------------
Date: 18 Sep 2003 02:48:04 GMT
From: Sam Holden <sholden@staff.cs.usyd.edu.au>
Subject: Re: @_ in subroutine corrupts data?
Message-Id: <slrnbmi774.pmk.sholden@staff.cs.usyd.edu.au>
On Wed, 17 Sep 2003 23:28:39 -0300, synthespian <synthespian@uol.com.br> wrote:
> hello --
>
> I can find no reasonable explanation for this behavior. Not theat
> there's isn't one (a trivial one at that), but I am having a hard time
> finding the reason for this:
>
> #!/usr/bin/perl
you are missing use strict; and use warnings; (or -w).
>
> @array = subthis(1, 2, 3, 4);
>
> sub subthis {
>
> @array = @_;
> foreach (@array) {
That will set $_ to 1, then 2, then 3, then 4.
> print "$array[$_]\n";
Since arrays start at element 0 (well, in sane code anyway) that will
print the second element when $_ is 1, the third when $_ is 2, the
fourth when $_ is 3, and the fifth when $_ is 4.
> }
> return (@array);
> }
>
> print "Finished\n";
>
> $ perl subrout2.pl
> 2
> 3
> 4
>
Notice the blank line, that's $array[4] which is undef.
> Finished
>
>
> Whatever happened to the "1"?
You didn't print it.
> Is this behavior to be expected? Why?
Yes. Values aren't the same an indexes.
--
Sam Holden
------------------------------
Date: Thu, 18 Sep 2003 03:03:13 GMT
From: "Chris Dutton" <rubyguru@hotmail.com>
Subject: Re: @_ in subroutine corrupts data?
Message-Id: <Rf9ab.619$TM4.47@pd7tw2no>
"synthespian" <synthespian@uol.com.br> wrote in message
news:bkb5d9$p90ge$1@ID-78052.news.uni-berlin.de...
> #!/usr/bin/perl
>
> @array = subthis(1, 2, 3, 4);
>
> sub subthis {
>
> @array = @_;
> foreach (@array) {
On each iteration $_ contains an actual element of the array, not just the
index.
> print "$array[$_]\n";
This should be written: print "$_\n";
As it is, you're using the item to do a look-up on the array. You've
already got this via foreach. The fact that you're getting anything close
to a correct output is...
> }
> return (@array);
> }
>
> print "Finished\n";
>
> $ perl subrout2.pl
> 2
> 3
> 4
... that the items in the array are (for the most part) valid indices for
that array, except that arrays in Perl begin with index zero, and your array
doesn't contain zero.
Also, by using @array in the "main" scope of your program, and inside the
"subthis" subroutine, your "@array = @_" line is always going to overwrite
the @array in the main scope.
The following does not have this problem.
#!/usr/bin/perl
@array = subthis(1, 2, 3, 4);
sub subthis {
my @array = @_;
foreach my $item (@array) {
print "$item\n";
}
return @array;
}
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.512 / Virus Database: 309 - Release Date: 8/19/2003
------------------------------
Date: Thu, 18 Sep 2003 00:23:29 -0300
From: synthespian <synthespian@uol.com.br>
Subject: Re: @_ in subroutine corrupts data?
Message-Id: <bkb8j5$rjcqj$1@ID-78052.news.uni-berlin.de>
Sam Holden wrote:
> On Wed, 17 Sep 2003 23:28:39 -0300, synthespian <synthespian@uol.com.br> wrote:
>
>>hello --
>>
>> I can find no reasonable explanation for this behavior. Not theat
>>there's isn't one (a trivial one at that), but I am having a hard time
>>finding the reason for this:
>>
>>#!/usr/bin/perl
>
>
> you are missing use strict; and use warnings; (or -w).
>
>
>>@array = subthis(1, 2, 3, 4);
>>
>>sub subthis {
>>
>> @array = @_;
>> foreach (@array) {
>
>
> That will set $_ to 1, then 2, then 3, then 4.
>
>
>> print "$array[$_]\n";
>
>
> Since arrays start at element 0 (well, in sane code anyway) that will
> print the second element when $_ is 1, the third when $_ is 2, the
> fourth when $_ is 3, and the fifth when $_ is 4.
>
Yes, it's obvious! Thanks to you and Chris Dutton for taking the time.
I thought that what would be set to $_ was the /number/ of elements in
@array, and not 1, 2, 3, 4, and that this number would start at 0.
Like Dave said, "Since arrays are 0-indexed, you are getting three
values and an undefined
fourth value. I think what you meant to say was:
print "$_\n";
Instead of:
print "$array[$_]\n";
So this is about context, is it? $_ will be the placeholder for an
array indexed when $array[$_], otherwise it is not 0-indexed, that is,
is $_ in the case of print "$_\n" evaluating to the number of elements?
Or is it a placeholder for the /elements/ themselves?
What's up with this (perceived) inconsistency?
Thanks for answering.
Regs,
Henry
------------------------------
Date: 17 Sep 2003 17:32:03 -0700
From: tjeremy@eudoramail.com (Teresa Jeremy)
Subject: Automate Perl module
Message-Id: <c43a49a6.0309171632.6c7be3c6@posting.google.com>
I'm using ActiveState ActivePerl 5.6 as my helper script for Windows
2K/XP deployment. During OS deployment, I install ActivePerl
automatically using the MSI installer. However, I would like to
automatically install some additional Perl modules so that I can write
computer info back to a mysql database.
The perl -MCPAN -e shell command prompts me for configuration info on
first run. I'd like to use the Perl Package Manager to automate the
installation of additional modules.
Any ideas?
Thanx.
TJ
------------------------------
Date: Thu, 18 Sep 2003 03:00:01 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: Automate Perl module
Message-Id: <3F691FAB.6030005@rochester.rr.com>
Teresa Jeremy wrote:
> I'm using ActiveState ActivePerl 5.6 as my helper script for Windows
> 2K/XP deployment. During OS deployment, I install ActivePerl
> automatically using the MSI installer. However, I would like to
> automatically install some additional Perl modules so that I can write
> computer info back to a mysql database.
>
> The perl -MCPAN -e shell command prompts me for configuration info on
> first run. I'd like to use the Perl Package Manager to automate the
> installation of additional modules.
...
> TJ
Maybe I'm missing something, but why can't you just include lines like:
ppm install module-name
in a DOS batch file that runs on your target computer once Perl is up
and going on it?
Or maybe better yet, just prepare a directory on a server with the Perl
configuration you want, and copy it over and fix up the path and
environment variables as desired, with no need to do anything else?
Seems like you're making it way more complicated than it has to be.
--
Bob Walton
------------------------------
Date: Wed, 17 Sep 2003 21:54:13 GMT
From: Pacman <piercer@nospam_pacbell.net>
Subject: Compiling Curses in OS X for Perl
Message-Id: <170920031454279229%piercer@nospam_pacbell.net>
A note to anyone wanting to get Curses to compile under OS X 10.2.6.
I had to make some changes to the standard c-config.h hints file, the
old 'darwin' one does not work due to conflicts between some perl
definitions and curses.h definitions namely:
instr
bool
FIELD
here's the c-config.h file I altered:
/* Hint file for the darwin platform.
*
* If this configuration doesn't work, look at the file "c-none.h"
* for how to set the configuration options.
*/
#include <curses.h>
#ifdef C_PANELSUPPORT
#include <panel.h>
#endif
#ifdef C_MENUSUPPORT
#include <menu.h>
#endif
/* OK this is hackish, but it solves the problem. */
#ifdef C_FORMSUPPORT
#include "/usr/include/form.h"
#endif
/* FIX: OS X longname only takes 0 args now */
#define C_LONGNAME
#define C_LONG0ARGS
#undef C_LONG2ARGS
/* FIX: OS X touchline is now 3 args */
#define C_TOUCHLINE
#define C_TOUCH3ARGS
#undef C_TOUCH4ARGS
/* These both get defined in curses.h and then redefined later in
Perl.h */
#undef instr
#undef bool
P-
--
#############
Imagination is more important than knowledge - A. Einstein
------------------------------
Date: Thu, 18 Sep 2003 00:10:24 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: current path
Message-Id: <QJ6ab.29$E36.13@nwrddc02.gnilink.net>
Jochen Friedmann wrote:
> how can I find the current path my Perlscript is started ?
Please define "current path".
If you are talking about the current working directory, then please have a
look at Cwd::cwd.
If you are talking about the location of the Perl script in your filesystem,
then please check $FindBin::Bin.
Or $0.
Either of them may or may not work for your specific requirements.
jue
------------------------------
Date: Wed, 17 Sep 2003 15:58:49 -0700
From: Chief Squawtendrawpet <cs@edu.edu>
Subject: Re: Database Record into a hash...
Message-Id: <3F68E729.8B42A351@edu.edu>
Donavon wrote:
> while ($data = $sth->fetchrow_hashref) {
> %record = %$data;
> $key = $record{'ProjectNumber'};
> $hash{$key} = \%record;
> };
Each time through the loop, the key-value pairs in %record may be
changing, but %record itself is still the same old hash to which all
of the refs in %hash keep pointing.
One way to solve your problem is to dispense with the intermediary
(%record) and work directly with the ref in $data.
$hash{ $data->{ProjectNumber} } = $data;
Another way to solve the problem is to take Tad's advice:
my %record = %$data;
This has the effect of defining a "fresh copy" of %hash each time
through the loop -- at least that's how I lamely understand it. Maybe
one of the experts around here could offer a better explanation,
becuase this behavior has always been a little bit mysterious to me.
Chief S.
------------------------------
Date: Wed, 17 Sep 2003 17:22:18 -0700
From: "superfly2" <darius_fatakia@yahoo.com>
Subject: DBI.pm fetchrow() issue
Message-Id: <bkatrs$215$1@news.Stanford.EDU>
Hi, the while loop I use to print each result of my SQL query seems to stop
when it encounters the FIRST NULL value (although there are other non-NULL
values still left to be printed. How can I avoid this so that I print all
the non-NULL values? Thanks.
My code is as follows:
my $sthv=$dbh->prepare($queryv);
$sthv->execute();
Now, for every output value
while(my $val = $sthv->fetchrow())
{
print OUTPUT "$val\n";
}
It prints:
| Klk7 |
| D10Ucla1 |
| Whsc2h |
| Oaz2 |
Instead of (from a query done directly in SQL):
| Klk7 |
| D10Ucla1 |
| Whsc2h |
| Oaz2 |
| NULL |
| Slc25a2 |
| Slc25a15 |
| Hornerin-pending |
| NULL |
| D6Ucla1e |
| Odcp-pending |
| Whsc1l1 |
| Oaz3 |
| NULL |
| NULL |
| NULL |
| NULL |
| NULL
------------------------------
Date: Wed, 17 Sep 2003 18:25:27 -0700
From: Steve May <drumspoorly@reachone.net>
Subject: Re: DBI.pm fetchrow() issue
Message-Id: <vmi1mmsdqs2323@corp.supernews.com>
superfly2 wrote:
> Hi, the while loop I use to print each result of my SQL query seems to stop
> when it encounters the FIRST NULL value (although there are other non-NULL
> values still left to be printed. How can I avoid this so that I print all
> the non-NULL values? Thanks.
Uh.... are you running, or at least testing with warnings on?
Doesn't sound like it...
>
> My code is as follows:
>
> my $sthv=$dbh->prepare($queryv);
> $sthv->execute();
>
> Now, for every output value
> while(my $val = $sthv->fetchrow())
> {
>
$val or next;
print OUTPUT "$val\n";
> }
>
At least at first glance....
s.
------------------------------
Date: Thu, 18 Sep 2003 03:15:52 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: DBI.pm fetchrow() issue
Message-Id: <3F692363.6090102@rochester.rr.com>
superfly2 wrote:
> Hi, the while loop I use to print each result of my SQL query seems to stop
> when it encounters the FIRST NULL value (although there are other non-NULL
> values still left to be printed. How can I avoid this so that I print all
> the non-NULL values? Thanks.
>
> My code is as follows:
>
> my $sthv=$dbh->prepare($queryv);
> $sthv->execute();
>
> Now, for every output value
> while(my $val = $sthv->fetchrow())
---------------------------^^^^^^^^
Uh, are you sure? DBI does not contain a method called "fetchrow".
Maybe you mean fetchrow_array, but then you should have an array on the
lefthand side. Or maybe fetchrow_arrayref? But then you would need to
refer to the first element as $$val[0], not $val as you did below. So
what exactly is your *real* code? If you use either of the above
methods, you will not have this problem, as either will return a true
value when there is data and a false value when it stops (or an error
occurs), as in:
while(my @array=$sthv->fetchrow_array){...
or
while(my $array_ref=$sthv->fetchrow_arrayref){...
as is clearly stated in the DBI documentation.
> {
> print OUTPUT "$val\n";
> }
>
...
HTH.
--
Bob Walton
------------------------------
Date: Wed, 17 Sep 2003 17:16:21 -0700
From: Jim Gibson <jgibson@mail.arc.nasa.gov>
To: SRam <aksivaram2k2@yahoo.com>
Subject: Re: Forking Server
Message-Id: <3F68F955.10209@mail.arc.nasa.gov>
SRam wrote:
> I a writing Forking Server for a Small application..
Nobody else has replied constructively, so I will attempt to. I have not
used the IO::Socket module, but have done some server programming in C
and am familiar with some of the issues.
>
> This is code for multiplexing
>
> my $listen = IO::Socket::INET->new(Proto => 'tcp',LocalPort => 2323,
> Listen => 1, Reuse => 1)
> or die $!;
You probably want to increase Listen to more than 1. The default is
usually 5. If you leave it at only 1, you are liable to miss a client
when two or more try to connect at the same time. This number is the
number of waiting clients that will be queued up when trying to connect
to your socket.
>
> $listen->autoflush(1);
>
> my $readable_handles = new IO::Select();
> $readable_handles->add($listen);
> while (1)
> {
> $listen->autoflush(1);
This is probably redundant to the autoflush call above. Once set, this
switch shouldn't change.
> ($new_readable) = IO::Select->select($readable_handles, undef,
> undef, 0);
>
> foreach $sock (@$new_readable)
> {
>
> if ($sock == $listen)
> {
> my $new_sock = $sock->accept();
You now have a handle to a socket object for a newly-connected client.
If you want to fork off a process to serve this client, this is the
place to do it. In that case, you probably don't want to add this client
to the set of sockets being waited on by the select statement, and your
select statement will never be looking at more than one socket: the
original server socket.
> $readable_handles->add($new_sock);
> $count++;
> $flag = 0;
> print $new_sock->fileno . ": connected\n";
> }
> else
> {
You now have a handle to an IO::Socket::INET object that has data ready
for reading. If you want to fork off a process to process the data, this
is the place to do it.
> $sock->recv($line,300);
> print "Received Message\n";
> print "Message = $line\n";
> ......operations....
> }
> }
> }
>
> I also got code for Forking Server from advanced perl programming
>
> # Forking server
> use IO::Socket;
> $SIG{CHLD} = sub {wait ()};
> $main_sock = new IO::Socket::INET (LocalHost => 'goldengate',
> LocalPort => 1200,
> Listen => 5,
> Proto => 'tcp',
> Reuse => 1,
> );
> die "Socket could not be created. Reason: $!\n" unless ($sock);
> while ($new_sock = $main_sock->accept()) {
> $pid = fork();
> die "Cannot fork: $!" unless defined($pid);
> if ($pid == 0) {
> # Child process
> while (defined ($buf = <$new_sock>)) {
> # do something with $buf ....
> print $new_sock "You said: $buf\n";
> }
> exit(0); # Child process exits when it is done.
> } # else 'tis the parent process, which goes back to accept()
> }
> close ($main_sock);
>
> I need to convert the multipexing one of first to forking..I don't
> know exactly where to modify...Can Anyone help me get me the exact
> code...
You haven't explained why you want to do this. In general, a server
would be implemented either by multiplexing or multiprocessing
(forking). Multiplexing using select lets you get data from a client
without blocking because you are told when the data is ready. The
advantage is simplicity (once you figure out how the select statement
works), efficiency (because you only have one process), and
responsiveness (because you don't have to wait for a process to fork).
The disadvantage is unresponsiveness if it takes a long time to service
a client, and other clients are waiting. Advanced Perl Programming, by
Srinivasan, discusses both of these approaches.
So why do you want to do both multiplexing and multiprocessing?
------------------------------
Date: Wed, 17 Sep 2003 16:51:41 -0600
From: Eric Schwartz <emschwar@pobox.com>
Subject: Re: How do I change my directory back?
Message-Id: <etollsndo5e.fsf@wormtongue.emschwar>
gvictor97@yahoo.com (Victor) writes:
> $mydir = `pwd`;
use Cwd;
my $mydir = getcwd;
> &s1;
> &s2;
Don't call subs with & unless you know why you're doing it. perldoc
perlsub to find out more.
> sub s1 {
> system "mkdir dd1";
> chdir "dd1";
> ....
> ....
> chdir $mydir;
>
> }
You really should ask Perl for all the help it can give you first.
use strict; and use warnings; won't help this problem, but they will
likely help you find and fix other problems early on.
In this case, however, you're calling chdir(), you know it's failing,
and you're not checking the result of the call to find out why.
perldoc -f chdir tells you:
It returns true upon success, false otherwise.
See the example under "die".
The examples (from 'perldoc -f die') are pretty clear, I think:
Equivalent examples:
die "Can't cd to spool: $!\n" unless chdir '/usr/spool/news';
chdir '/usr/spool/news' or die "Can't cd to spool: $!\n"
I personally prefer the second form, but have no good reason for doing
so.
> Any help will be highly appreciated.
c.l.p.m helps those best who help themselves. :)
-=Eric
--
Come to think of it, there are already a million monkeys on a million
typewriters, and Usenet is NOTHING like Shakespeare.
-- Blair Houghton.
------------------------------
Date: Wed, 17 Sep 2003 17:56:31 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: How do I change my directory back?
Message-Id: <slrnbmhpkv.8ot.tadmc@magna.augustmail.com>
Victor <gvictor97@yahoo.com> wrote:
> 1- create dir dd1
> 2- chdir to dd1
> 3- do things
> 4- chdir back to original dir
> 5- create dir dd2
> 6- chdir to dd2
> 7- do things
>
> But, chdir to prev dir does not happen at step 4.
> chdir $mydir;
> Any help will be highly appreciated.
Ask perl to help you by checking the return value from chdir():
chdir $mydir or die "could not cd to '$mydir' $!";
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Thu, 18 Sep 2003 02:06:53 GMT
From: "Tman" <nerdy1@snet.net>
Subject: I know I can do this with a regex, but...
Message-Id: <1r8ab.3583$z15.479@newssvr33.news.prodigy.com>
Need to strip comments from VBScript code.
Tried to use a state machine to tell if I was in quotes, but got very
confused. I know I can use a regex, although I may have to call it
repeatedly to eat quoted strings. Anyone have ideas?
I need to whack everything after the first comment character...
this is not a comment
'this line is fully commented
the comment 'in this line starts after ' the word comment
there "is no 'comment" in this line
but in "this 'line" there 'is a "comment" before the word "is"
'this line is "fully" commented
ad infinitum...
------------------------------
Date: Thu, 18 Sep 2003 00:16:55 +0000 (UTC)
From: "David H. Adler" <dha@panix.com>
Subject: Re: locatime()
Message-Id: <slrnbmhubn.mj3.dha@panix2.panix.com>
In article <59b4279a.0309170319.d188a7e@posting.google.com>, Tom wrote:
>
> Reference book such as Programming Perl is a good alternate source of
> getting the type of information that you're looking for.
As long as you keep in mind that it's an *alternate* source. The books
are not the definitive documentation, and are often out of date. I
think the last edition of PP covers 5.6.0 (certainly no later than
5.6.1).
dha
--
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
It's about hoodwinking the viewer in the cheapest and easiest manner
possible - Markku Pätilä
------------------------------
Date: Thu, 18 Sep 2003 00:41:30 -0300
From: synthespian <synthespian@uol.com.br>
Subject: package problem? [was Re: @_ in subroutine corrupts data?]
Message-Id: <bkb9kv$qum8m$1@ID-78052.news.uni-berlin.de>
While we're on this, it got weird with "strict" and "warnings". Why?
@arrayb = subthat(1, 2, 3, 4);
sub subthat {
@arrayb = @_;
foreach (@arrayb) {
print "$_\n";
}
}
print "Finished\n";
$ perl subrout3.pl
Global symbol "@arrayb" requires explicit package name at subrout3.pl
line 5.
Global symbol "@arrayb" requires explicit package name at subrout3.pl
line 9.
Global symbol "@arrayb" requires explicit package name at subrout3.pl
line 10.
Execution of subrout3.pl aborted due to compilation errors.
TIA
Henry
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V10 Issue 5519
***************************************