got it!
perl complains about a file handler opened but never used. If I add:
close MAILBOX;
at the end of the script, the warning disappears.
Sorry, wrote too faster than my brain :-)
m.
On Thu, 2005-01-20 at 16:29, Mariano Cunietti wrote:
> I'm trying to run this script:
>
> #=============================
> #!/usr/bin/perl
> use strict;
> use warnings;
>
> my $user=$ARGV[0];
> open (MAILBOX, "/var/spool/mail/".$user) or die ("Unable to open mailbox
> for user ".$user."!\n");
> print "OK\n";
> #============================
>
> passing a username as argument. I get the following output:
>
> [EMAIL PROTECTED] perl]# echo "postmaster" | ./extract_from_mbox.pl
> Name "main::MAILBOX" used only once: possible typo at
> ./extract_from_mbox.pl line 6.
> Use of uninitialized value in concatenation (.) or string at
> ./extract_from_mbox.pl line 6.
> OK
>
> If I disable "use warnings;" it's obviously all going smoothly, and I
> get only "OK".
>
> I've googled around for a while but neither newsgroup nor my O'Reilly
> manual gave any advice.
> Can you help me?
>
> Thanks
>
>
> -----------------------------
> Mariano Cunietti
> System Administrator
> Enter S.r.l.
> Via Stefanardo da Vimercate, 28
> 20128 - Milano - Italy
> Tel. +39 02 25514319
> Fax +39 02 25514303
> [EMAIL PROTECTED]
> www.enter.it - www.enterpoint.it
> -----------------------------
> Gruppo Y2K - www.gruppoy2k.it
--
-----------------------------
Mariano Cunietti
System Administrator
Enter S.r.l.
Via Stefanardo da Vimercate, 28
20128 - Milano - Italy
Tel. +39 02 25514319
Fax +39 02 25514303
[EMAIL PROTECTED]
www.enter.it - www.enterpoint.it
-----------------------------
Gruppo Y2K - www.gruppoy2k.it
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>