|
hi david --
In a message dated 7/20/2006 5:26:16 P.M. Eastern Standard Time,
[EMAIL PROTECTED] writes:
> Ok, but what are the consequences? Sorry, but I have been on my own
within my
> environment for most of my Perl life. I have the conferences I went to initially, > books and the mailing lists, but otherwise on my own. I have a working environment > which does internally quite a bit of emailing to different parts of the organization > and most if not all of my cases have || and NOT or. > Any insight would be greatly appreciated. > Thanks. > > Wags ;) WGO: x2224 > > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: Thursday, July 20, 2006 13:59 > To: Wagner, David --- Senior Programmer Analyst --- WGO > Cc: [email protected]; [EMAIL PROTECTED]; > Curtis Leach > Subject: RE: Problems with Archive::Tar under XP - Perl v5.8.8.817 > > > > No. You want to use "or", NOT "||" in these cases..... > > Deane Rothenmaier, Systems Architect, > Walgreens Corp. > 847-914-5150 > > "The shortest distance between two points is under construction." -- "Big > John" Howell > > "Wagner, David --- Senior Programmer Analyst --- WGO" > <[EMAIL PROTECTED]> Sent by: activeperl- > [EMAIL PROTECTED] 07/20/2006 03:51 PM > > > To: "Curtis Leach" <[EMAIL PROTECTED]>, <[email protected]> > cc: > Subject: RE: Problems with Archive::Tar under XP - Perl v5.8.8.817 > > > > I ran into a nasty bug with Archive::Tar under Windows. I want to extract > the files to a particular location, but whenever I run it, instead of > putting the results on drive "D:", it put's it on drive "C:", where the > program is running. After mucking through Tar.pm, I found it throws away > the drive information. (Which finally allowed me to notice where my test > program was extracting the files to when they were not showing up in the > current directory or in the expected location.) So my question is this, is > there a Perl command to change what drive you are on after you start your > program? I hate writing OS specific code, but this bug is forcing me into > this. > > You can do chdir($newdirloc) || # die or whatever here if directory does > not exist or problem > > Wags ;) in the specific example given above, it makes no difference.
however, in
``preferred'' perlish idioms like
open my $fh, '>', 'somefile' or die "opening
somefile: $! ";
print $fh 'hello there' or die "writing somefile:
$!";
the much lower precedence of the or operator sure does make a
difference.
see the discussions of ``List Operators (Rightward)'' and ``Logical or
and Exclusive
Or'' in
perldoc perlop
and also check out
perldoc perlopentut
(there are probably some better discussions elsewhere, but i can't remember
where just now.)
hth -- bill walters
|
_______________________________________________ ActivePerl mailing list [email protected] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
