HP3000-L Archives

September 2001, Week 3

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Ken Hirsch <[log in to unmask]>
Reply To:
Ken Hirsch <[log in to unmask]>
Date:
Fri, 21 Sep 2001 15:48:56 -0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (55 lines)
I dunno, works for me.  Perhaps you have some control characters in one of
your variables, although the usual suspects [\r\n] would have shown up in
your error message.  You could  print length("$spooldir/$mfile") to see if
it is what you expect.  Of course, always run perl with -w if you have any
problems.



----- Original Message -----
From: "Duane R. Larkin" <[log in to unmask]>
To: <[log in to unmask]>
Sent: Friday, September 21, 2001 2:44 PM
Subject: Perl (unlink) Question...


> I cannot get PERL to succuessfully "unlink" a file.  From the shell, it
> works:
>
> shell/iX> ls -l /AUTOMATC/PUB/spool/O44698
> -rw-rw-rw-   1 MGR.NETBASE       AUTOMATC    2048 Sep 21 11:48
> /AUTOMATC/PUB/spo
> ol/O44698
> shell/iX> rm /AUTOMATC/PUB/spool/O44698
> shell/iX> ls -l /AUTOMATC/PUB/spool/O44698
> ls: File or directory "/AUTOMATC/PUB/spool/O44698" is not found
> shell/iX>
>
> From PERL, I get:
>
> Cannot delete file (/AUTOMATC/PUB/spool/O44424) (System call error) at
> /AUDIT/A
> TO/basicio.pl line 133, <INPUT> line 42.
>
> My PERL code looks like:
>
>     unlink "$spooldir/$mfile" or die "Cannot delete file
($spooldir/$mfile)
> ($!)";
>
> Now, if I do something like:
>
>     unlink "/AUTOMATC/PUB/spool/O44424" or die "Cannot delete file
> ($spooldir/$mfile) ($!)";
>
> IT WORKS!  Why not with variables?
>
>
> Duane "The Question Man" Larkin
>
> * To join/leave the list, search archives, change list settings, *
> * etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2