[21829] in Perl-Users-Digest
Perl-Users Digest, Issue: 4033 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Oct 27 00:06:28 2002
Date: Sat, 26 Oct 2002 21:05:07 -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 Sat, 26 Oct 2002 Volume: 10 Number: 4033
Today's topics:
backticks/system command <gbh@fpcc.net>
Re: backticks/system command <jeff@vpservices.com>
Re: backticks/system command <bwalton@rochester.rr.com>
Re: backticks/system command <gbhDELETE@fpcc.net>
Re: backticks/system command <gbhDELETE@fpcc.net>
Re: backticks/system command <gbhDELETE@fpcc.net>
Re: Before I buy the Book ... <comdog@panix.com>
Re: Before I buy the Book ... <pasdespam_desmond@zeouane.org>
Re: Before I buy the Book ... <flavell@mail.cern.ch>
Re: Before I buy the Book ... <pasdespam_desmond@zeouane.org>
Re: Before I buy the Book ... <wsegrave@mindspring.com>
Re: Before I buy the Book ... <Amadeus@none.com>
Re: MD5 password encryption <cheechew@hotmail.com>
Re: MD5 password encryption (James Willmore)
newbie LWP redirect/cookie question (RP)
Re: newbie LWP redirect/cookie question <pa@panix.com>
Re: Replacing string in binary file <jurgenex@hotmail.com>
Re: Sendmail Bcc doesn't work (Serge)
Re: Sendmail Bcc doesn't work (Jay Tilton)
Re: Simple Question on Hash ... (Jay Tilton)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 26 Oct 2002 19:29:43 -0600
From: Gary Hodges <gbh@fpcc.net>
Subject: backticks/system command
Message-Id: <3DBB4187.1A3476F3@fpcc.net>
I'm missing something basic. I've distilled my problem down to the
following code:
#---------------
use strict;
my $file = "any.doc";
my $cmd ="D:\\Program Files\\Microsoft Office\\Office\\WINWORD.EXE";
`\"$cmd\" \"$file\"`;
#system "\"$cmd\" \"$file\"";
#system ("\"$cmd\" \"$file\"");
#system (qq|\"$cmd\" \"$file\"|);
#system qq|\"$cmd\" \"$file\"|;
#system qq|"$cmd" "$file"|;
#---------------
When I run this using the backticks line or any of the system lines I
get a complaint that
'D:\Program'
is not a known command. The short question is "What I missing here?"
What do I need to do to get the full command with spaces executed?
The slightly longer question is any of the above works with 5.6.1 but
not 5.6.0 ActiveState. I was trying to make an executable with perl2exe
and 5.6.1 but would keep getting that error message. I noticed on the
perl2exe web site that the latest version was compatible with
ActiveState 5.6.0 build 623 so I installed that version thinking it
might fix my problem, but here I am.
Gary
------------------------------
Date: Sat, 26 Oct 2002 18:49:35 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: backticks/system command
Message-Id: <3DBB462F.8030002@vpservices.com>
Gary Hodges wrote:
> I'm missing something basic. I've distilled my problem down to the
> following code:
> #---------------
> use strict;
> my $file = "any.doc";
> my $cmd ="D:\\Program Files\\Microsoft Office\\Office\\WINWORD.EXE";
> `\"$cmd\" \"$file\"`;
Much simpler to just do:
my $file = "any.doc";
`start winword $file`;
Notice the "start", not that has much to do with perl.
--
Jeff
------------------------------
Date: Sun, 27 Oct 2002 02:44:10 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: backticks/system command
Message-Id: <3DBB52F7.10209@rochester.rr.com>
Gary Hodges wrote:
> I'm missing something basic. I've distilled my problem down to the
> following code:
> #---------------
> use strict;
> my $file = "any.doc";
> my $cmd ="D:\\Program Files\\Microsoft Office\\Office\\WINWORD.EXE";
> `\"$cmd\" \"$file\"`;
>
> #system "\"$cmd\" \"$file\"";
> #system ("\"$cmd\" \"$file\"");
> #system (qq|\"$cmd\" \"$file\"|);
> #system qq|\"$cmd\" \"$file\"|;
> #system qq|"$cmd" "$file"|;
> #---------------
>
> When I run this using the backticks line or any of the system lines I
> get a complaint that
> 'D:\Program'
> is not a known command. The short question is "What I missing here?"
> What do I need to do to get the full command with spaces executed?
It doesn't appear to me that you are missing anything. They all work
fine on my system (Windoze 98SE, AS Perl build 633, with D: replaced by
C: since Word is on C: on my system). What version of Windoze are you
using?
...
> Gary
--
Bob Walton
------------------------------
Date: Sat, 26 Oct 2002 21:07:22 -0600
From: Gary Hodges <gbhDELETE@fpcc.net>
Subject: Re: backticks/system command
Message-Id: <3DBB5869.9C655B12@fpcc.net>
Bob Walton wrote:
> Gary Hodges wrote:
>
> > I'm missing something basic. I've distilled my problem down to the
> > following code:
> > #---------------
> > use strict;
> > my $file = "any.doc";
> > my $cmd ="D:\\Program Files\\Microsoft Office\\Office\\WINWORD.EXE";
>
> > `\"$cmd\" \"$file\"`;
> >
> > #system "\"$cmd\" \"$file\"";
> > #system ("\"$cmd\" \"$file\"");
> > #system (qq|\"$cmd\" \"$file\"|);
> > #system qq|\"$cmd\" \"$file\"|;
> > #system qq|"$cmd" "$file"|;
> > #---------------
> >
> > When I run this using the backticks line or any of the system lines I
> > get a complaint that
> > 'D:\Program'
> > is not a known command. The short question is "What I missing here?"
> > What do I need to do to get the full command with spaces executed?
>
> It doesn't appear to me that you are missing anything. They all work
> fine on my system (Windoze 98SE, AS Perl build 633, with D: replaced by
> C: since Word is on C: on my system). What version of Windoze are you
> using?
This is on a Win2000 install. perl -v gives v5.6.0 build 623. When I
install v5.6.1 build (I think) 633 they all work. Ultimately I want to
make an "executable" with perl2exe. With the 633 build I would get the
same error I am getting now when I made an executable.
Curiously, if I run
`\"$cmd\"`;
by itself it opens Word.
Gary
------------------------------
Date: Sat, 26 Oct 2002 21:15:32 -0600
From: Gary Hodges <gbhDELETE@fpcc.net>
Subject: Re: backticks/system command
Message-Id: <3DBB5A54.AEDC5185@fpcc.net>
Jeff Zucker wrote:
> Gary Hodges wrote:
>
> > I'm missing something basic. I've distilled my problem down to the
> > following code:
> > #---------------
> > use strict;
> > my $file = "any.doc";
> > my $cmd ="D:\\Program Files\\Microsoft Office\\Office\\WINWORD.EXE";
> > `\"$cmd\" \"$file\"`;
>
> Much simpler to just do:
>
> my $file = "any.doc";
> `start winword $file`;
>
> Notice the "start", not that has much to do with perl.
I really want to keep this general. I don't want to open just Word, but
any program entered in a config file. I just tried playing around with
"start" some without much success. Can I incorporate "start" in my
example above?
Gary
------------------------------
Date: Sat, 26 Oct 2002 21:57:25 -0600
From: Gary Hodges <gbhDELETE@fpcc.net>
Subject: Re: backticks/system command
Message-Id: <3DBB6425.44280923@fpcc.net>
Gary Hodges wrote:
> Bob Walton wrote:
>
> > Gary Hodges wrote:
> >
> > > I'm missing something basic. I've distilled my problem down to the
> > > following code:
> > > #---------------
> > > use strict;
> > > my $file = "any.doc";
> > > my $cmd ="D:\\Program Files\\Microsoft Office\\Office\\WINWORD.EXE";
> >
> > > `\"$cmd\" \"$file\"`;
> > >
> > > #system "\"$cmd\" \"$file\"";
> > > #system ("\"$cmd\" \"$file\"");
> > > #system (qq|\"$cmd\" \"$file\"|);
> > > #system qq|\"$cmd\" \"$file\"|;
> > > #system qq|"$cmd" "$file"|;
> > > #---------------
> > >
> > > When I run this using the backticks line or any of the system lines I
> > > get a complaint that
> > > 'D:\Program'
> > > is not a known command. The short question is "What I missing here?"
> > > What do I need to do to get the full command with spaces executed?
> >
> > It doesn't appear to me that you are missing anything. They all work
> > fine on my system (Windoze 98SE, AS Perl build 633, with D: replaced by
> > C: since Word is on C: on my system). What version of Windoze are you
> > using?
>
> This is on a Win2000 install. perl -v gives v5.6.0 build 623. When I
> install v5.6.1 build (I think) 633 they all work. Ultimately I want to
> make an "executable" with perl2exe. With the 633 build I would get the
> same error I am getting now when I made an executable.
>
> Curiously, if I run
> `\"$cmd\"`;
> by itself it opens Word.
I have just had success. I finally stumbled across the following combination
of quotes that worked:
`""$cmd" "$file""`;
That opens Word with the document. I haven't played around with the other
system commands yet.
Gary
------------------------------
Date: Sat, 26 Oct 2002 17:47:31 -0500
From: brian d foy <comdog@panix.com>
Subject: Re: Before I buy the Book ...
Message-Id: <261020021747313383%comdog@panix.com>
In article <slrnarlr2a.1h50.pasdespam_desmond@lievre.voute.net>, Desmond Coughlan <pasdespam_desmond@zeouane.org> wrote:
> Le Sat, 26 Oct 2002 16:06:59 GMT, ebchang <echang@netstorm.net> a Ècrit :
> > To any people, "shit" is not only perjorative, it is obscene and highly
> > offensive.
> With respect, I have apologised and shall not do so again. If you consider
> 'shit' to be 'obscene and highly offensive', then I can only assume that
> your native language is not English.
my native language is English, and i found your use of it obscene and highly
offensive, and i find your further explanation equally offensive. when you're
trying to get out of a hole, first stop digging.
*plonk*
--
brian d foy <comdog@panix.com> - Perl services for hire
The Perl Review - a new magazine devoted to Perl
<http://www.theperlreview.com>
------------------------------
Date: Sat, 26 Oct 2002 23:04:37 +0000
From: Desmond Coughlan <pasdespam_desmond@zeouane.org>
Subject: Re: Before I buy the Book ...
Message-Id: <slrnarm7s5.1hge.pasdespam_desmond@lievre.voute.net>
Le Sat, 26 Oct 2002 17:47:31 -0500, brian d foy <comdog@panix.com> a écrit :
{ snip }
>> With respect, I have apologised and shall not do so again. If you consider
>> 'shit' to be 'obscene and highly offensive', then I can only assume that
>> your native language is not English.
> my native language is English,
Whilst you're digging, remember how to spell 'pejorative'.
{ snip remainder of agressive and unwarranted attack in wake of genuine
misunderstanding }
--
Desmond Coughlan |CUNT#1 YGL#4 YFC#1 YFB#1 UKRMMA#14 two#38
desmond @ zeouane.org |BONY#48 ANORAK#11
http: // www . zeouane . org
------------------------------
Date: Sun, 27 Oct 2002 01:19:42 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Before I buy the Book ...
Message-Id: <Pine.LNX.4.40.0210270113240.5393-100000@lxplus074.cern.ch>
On Oct 26, Desmond Coughlan inscribed on the eternal scroll:
> With respect, I have apologised and shall not do so again.
The killfile awaits...
> If you consider 'shit' to be 'obscene and highly offensive', then
> I can only assume that your native language is not English.
If you're incapable of engaging in technical discussions without use
of obscenities, then that's clear enough. Dig your own hole.
My "native" language is Black Country, if anyone cares. Nearest
extant relative to anglo saxon, as some believe. Doesn't prevent me
from engaging in civilised discourse when it's appropriate.
bye.
------------------------------
Date: Sun, 27 Oct 2002 00:16:34 +0000
From: Desmond Coughlan <pasdespam_desmond@zeouane.org>
Subject: Re: Before I buy the Book ...
Message-Id: <slrnarmc32.1hge.pasdespam_desmond@lievre.voute.net>
Le Sun, 27 Oct 2002 01:19:42 +0200, Alan J. Flavell <flavell@mail.cern.ch> a écrit :
<fx: gobsmacked>
I didn't anticipate this reaction to the use of the word 'shit'. What, are
you all Mormons, or something ?
I apologised once. The use of the word 'shit' is so commonplace now as
to be almost meaningless. Never did I imagine that it would provoke
such an outcry.
Save your killfiles. I shall unsubscribe.
<aside: Jeeeeesus .....>
--
Desmond Coughlan |CUNT#1 YGL#4 YFC#1 YFB#1 UKRMMA#14 two#38
desmond @ zeouane.org |BONY#48 ANORAK#11
http: // www . zeouane . org
------------------------------
Date: Sat, 26 Oct 2002 18:52:45 -0500
From: "William Alexander Segraves" <wsegrave@mindspring.com>
Subject: Re: Before I buy the Book ...
Message-Id: <apfeua$tai$1@slb4.atl.mindspring.net>
"Desmond Coughlan" <pasdespam_desmond@zeouane.org> wrote in message
news:slrnarj9n1.6g6.pasdespam_desmond@lievre.voute.net...
> Hi,
> This is my first post here. I've been lurking for a while, trying to
> decide which book to buy to learn perl. After scouting around the web,
> and asking some friends, I've decided to buy _Learning Perl_ by Schwartz
> and Phoenix.
According to Randal, LP2 is dead. A few days ago, I saw several copies of
LP3 on the remainder shelves at B-A-M for about 1/2 price. perhaps this will
help you move to action on the purchase of LP3.
Bill Segraves
------------------------------
Date: Sat, 26 Oct 2002 22:32:13 -0500
From: "Amadeus" <Amadeus@none.com>
Subject: Re: Before I buy the Book ...
Message-Id: <3dbb5d70$1_5@news.sonicnews.com>
"Desmond Coughlan" <pasdespam_desmond@zeouane.org> wrote in message
news:slrnarmc32.1hge.pasdespam_desmond@lievre.voute.net...
> Le Sun, 27 Oct 2002 01:19:42 +0200, Alan J. Flavell
<flavell@mail.cern.ch> a écrit :
>
> <fx: gobsmacked>
>
> I didn't anticipate this reaction to the use of the word 'shit'. What,
are
> you all Mormons, or something ?
>
> I apologised once. The use of the word 'shit' is so commonplace now as
> to be almost meaningless. Never did I imagine that it would provoke
> such an outcry.
>
> Save your killfiles. I shall unsubscribe.
>
> <aside: Jeeeeesus .....>
What you have to realize, is that to many, Perl isn't a mere language, it's
a religion. So you can't refer to one of the holy scripts-ures as "shit,"
without getting a shitload of it in return.
------------------------------
Date: Sun, 27 Oct 2002 11:28:33 +0800
From: "cheechew" <cheechew@hotmail.com>
Subject: Re: MD5 password encryption
Message-Id: <apfmpi$clg$1@reader01.singnet.com.sg>
Brian McCauley,
Thanks for your explaination but I think you are over confidence of what
you know. Please think of broader angle. Why not think a scenario that
everytime you need to execute a perl program, the user need to enter the
passphrase manually. The program can be used by several users with their own
config file and own key.
Even if I put a key in the system itself, or it can be on another system,
all I need to do is secure the key file permission differently for different
users. In this way, different use can access the program with their own key
only. Now, you learn something? If people hacked into the system and have
root access, it can do anything they one. This is the OS security layer. Not
here.
I assume you are experience perl programmer before answering. There are a
few module that can do 3DES. If you are experince enough, you will be able
to tell me which is the best to suit my need. Everybody can do a search
quickly, but do you get the right thing at first place. That is what news
group to be, sharing knowledge.
Juha Laiho,
Yes there is a loop. What if a secure one of the elements of the loop? What
do you think?
------------------------------
Date: 26 Oct 2002 20:50:41 -0700
From: jwillmore@cyberia.com (James Willmore)
Subject: Re: MD5 password encryption
Message-Id: <e0160815.0210261950.e9fa592@posting.google.com>
Below is code used to make an encrypted file that will execute a
script ...
#!/usr/bin/perl -w
use strict;
use vars qw/$mode $key_chmod $keyfile_chmod $fh $digest $cmd $arg/;
use vars qw/$user $pass/;
die usage()
unless(@ARGV == 3);
$arg = $ARGV[0];
die "Command was not valid\n$arg: $!\n"
unless(-e $arg);
$user = $ARGV[1];
$pass = $ARGV[2];
$cmd = ".$arg";
$mode = '0400';
unless(-e ".key"){
open(KEY, "+>.key") or die "Could not create .key\n$!\n";
close KEY;
$key_chmod = chmod oct($mode), ".key";
($key_chmod) ? print "Ok\n" : die "Could not chmod .key\n$!\n";
}
use IO::File;
$fh = new IO::File ".key";
use Digest::SHA1;
$digest = new Digest::SHA1;
$digest->addfile($fh);
my $hash = $digest->hexdigest;
use Crypt::CBCeasy;
Blowfish::encipher($hash, "$arg $user $pass", "$cmd");
$keyfile_chmod = chmod oct($mode), "$cmd";
($keyfile_chmod) ? print "Ok\n" : die "Failed to properly create
keyfile\n";
print "Done\n";
exit;
sub usage{
print <<END;
usage: $0 <command> <username> <password>
END
exit;
}
And the following code is used to execute the script, using the
encrypted file you created above ...
#!/usr/bin/perl -w
use strict;
use vars qw/$fh $digest $hash $cmd $arg $data/;
die "Please provide a command to execute\n" unless (@ARGV == 1);
$arg = $ARGV[0];
$cmd = ".$arg" or die "Please provide a command to execute\n";
use IO::File;
$fh = new IO::File ".key";
use Digest::SHA1;
my $digest = new Digest::SHA1;
$digest->addfile($fh);
my $hash = $digest->hexdigest;
use Crypt::CBCeasy;
$data = Blowfish::decipher($hash, "$cmd");
system("$data");
exit;
Why post this? Simple. It is possible to secure usernames and
passwords in an encrypted format for use with scripts and/or
applications. And the MD5 idea, even if it was mis-understood by the
OP, is still a good idea when implemented properly. I used SHA, but
same principle - use a message digest as the key. And I used Blowfish
for the encryption of the username and password, but you can use
whatever Crypt::CBCeasy will accept.
This is NOT obfuscation of the username and password, but actually
securing them in a manner that's not 100%, but good enough to keep
prying eyes away from them.
HTH
Jim
> >MD5 could not be appropriate. How about 3DES with key. Any perl module
> >on that?
>
> And how would you protect that key? By encrypting that with 3DES and
> another key? You're stuck in a loop.
>
> If you need to store (within yuor program, or its data files) a password
> that you need to provide to some other entity as an authentication
> token, then, in essence, you'll have to store it as cleartext.
>
> You can obfuscate it, you can make it hard to find. But in the end, your
> program will contain the code to locate the data and also your program
> will contain the code to transform the data back to plaintext form.
>
> The end effect of this is that someone with your program and the data
> containing the (possibly obfuscated) password essentially has the
> plaintext password.
------------------------------
Date: 26 Oct 2002 17:46:46 -0700
From: izco@hotmail.com (RP)
Subject: newbie LWP redirect/cookie question
Message-Id: <9e7779b4.0210261646.10918db9@posting.google.com>
Hi all. Here's my problem: I'm using LWP::UserAgent, and I'm trying
to grab the data from a url and parse out what I need. I keep getting
a 302 Object Moved message. So from reading the messages here, I've
taken that to mean that I need to write a subroutine to handle a
redirect on the page. Two problems - number one, I can't figure out
how to get that to work; number two, I'm 99% sure that the page
doesn't redirect. Could it therefore be a cookie issue, or do I suck
at writing redirect sub? (I've tried countless variations that I've
found here and there, and none work.) I'm really lost on this, and I
apologize in advance if this is a stupid question, but I've really
been wracking my brain all week over this. I thought I was a pretty
good perl programmer til I hit this logjam! Thanks tons for your
help!
Here's the code from my page:
#!/usr/bin/perl -w
use strict;
use LWP::UserAgent;
my $url = 'http://www.expedia.com/pub/agent.dll?tovr=2002051103&ps3u=&temptrpt=2&defdate=10/26/2002&pcit1=&city1=LAX&airp1=&pctd1=&citd1=SEA&dair1=&date1=12/21/02&time1=362&date2=12/30/02&time2=362&bund=1&load=1&cAdu=1&cSen=0&cChi=0&tktt=3&stkc=1&stkp=1&stkr=1&flcr=&qscr=fexp&flag=q&subm=&cemd=0&chgf=0&wsds=&trpt=2&qryt=8&diag=';
my $ua = LWP::UserAgent->new();
$ua->agent("SecretBrowser/007");
$ua->timeout(360);
my $request = HTTP::Request->new(POST => $url);
my $response = $ua->request($request);
if ($response->is_success) {
print "Content-type: text/html\n\n";
print $response->content;
exit;
} else {
print "Error getting document: ", $response->status_line, "\n";
}
------------------------------
Date: Sun, 27 Oct 2002 01:27:41 +0000 (UTC)
From: Pierre Asselin <pa@panix.com>
Subject: Re: newbie LWP redirect/cookie question
Message-Id: <apffea$s9l$1@reader1.panix.com>
In <9e7779b4.0210261646.10918db9@posting.google.com> izco@hotmail.com (RP) writes:
>Hi all. Here's my problem: I'm using LWP::UserAgent, and I'm trying
>to grab the data from a url and parse out what I need. I keep getting
>a 302 Object Moved message. So from reading the messages here, I've
>taken that to mean that I need to write a subroutine to handle a
>redirect on the page.
No, LWP takes care of that. However, you're doing a POST, and redirects
for those are normally not honored, per one of the RFCs.
Your two choices are: 1) do a GET. 2) if you know for a fact that
the server expects a POST, enable redirects like this:
push @{ua->requests_redirectable}, 'POST';
Alternatively, put it in your constructor call:
my $ua= LWP::UserAgent->new(
requests_redirectable => ['GET', 'HEAD', 'POST'],
cookie_jar => HTTP::Cookies->new(),
);
That one will do cookies too. Full doc is at
http://search.cpan.org/author/GAAS/libwww-perl-5.65/lib/LWP/UserAgent.pm .
------------------------------
Date: Sun, 27 Oct 2002 02:57:43 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Replacing string in binary file
Message-Id: <HCIu9.29759$wm6.1038@nwrddc01.gnilink.net>
David K. Wall wrote:
> develop@gistenson.com wrote:
>
>> Tassilo,
>> You said that I should get rid of the develop@gistenson.com. I'll
>> look into how to do this and take care of it, if it poses a problem.
>
> What he said was "Also sprach develop@gistenson.com:". Note that
> Tassilo's email address is in Germany. "also sprach" is roughly
> equivalent to "thus spoke".
I guess develop is neither a fan of classic music nor of science fiction
movies. Otherwise he would have recognized the words.
Not that this has anything to do with Perl, of course ;-)
jue
------------------------------
Date: 26 Oct 2002 16:10:47 -0700
From: pulsar10@email.com (Serge)
Subject: Re: Sendmail Bcc doesn't work
Message-Id: <2481ff4b.0210261510.3ce408ae@posting.google.com>
tadmc@augustmail.com (Tad McClellan) wrote in message news:<slrnark3vf.1sf.tadmc@magna.augustmail.com>...
> Serge <pulsar10@email.com> wrote:
>
> > The person submits his email without the "\" before the "@"
> > so I used the following code to solve to put a backslash there:
>
>
> Why do you think that you need to insert a backslash?
>
>
> > # insert backslash into email $email_address of form someone@email.com
> > ($e_one,$e_two)=(split(/\@/,$email_address));
> > $e_full=$e_one."\\@".$e_two;
>
>
> You could have done that with a substitution instead:
>
> $email_address =~ s/\@/\\@/;
>
> But don't.
>
>
> > print SENDMAIL "Bcc: Student < $e_full >\n";
>
>
> > However, the script doesn't send the email to the student.
>
>
> Probably because there is a backslash in the address.
>
>
> > I can't
> > figure out what is wrong here.
>
>
> Don't add a backslash :-)
I need the backslash because it is a special character. Otherwise Perl
will think it's an array, wouldn't it? Also, the other email is with a
backslash (the
one in the "to" field) and it works. Other than that, I am not sure
what is wrong. Thanks for your help.
------------------------------
Date: Sat, 26 Oct 2002 23:29:09 GMT
From: tiltonj@erols.com (Jay Tilton)
Subject: Re: Sendmail Bcc doesn't work
Message-Id: <3dbb2334.4807863@news.erols.com>
pulsar10@email.com (Serge) wrote:
: tadmc@augustmail.com (Tad McClellan) wrote in message news:<slrnark3vf.1sf.tadmc@magna.augustmail.com>...
: > Serge <pulsar10@email.com> wrote:
: >
: > > The person submits his email without the "\" before the "@"
: > > so I used the following code to solve to put a backslash there:
: >
: > Don't add a backslash :-)
:
: I need the backslash because it is a special character.
Pursuing the logic, would not the backslash itself need to be
backslash-escaped? It too is a special character.
: Otherwise Perl
: will think it's an array, wouldn't it?
No. Double-quotish interpolation only goes one level deep. It
doesn't cascade through the interpolated strings.
: Also, the other email is with a
: backslash (the one in the "to" field) and it works.
When the '@' character is in the pre-interpolated string, it does need
escaping. If it's in one of the strings being interpolated into the
bigger string, fuggetaboutit.
------------------------------
Date: Sat, 26 Oct 2002 23:18:26 GMT
From: tiltonj@erols.com (Jay Tilton)
Subject: Re: Simple Question on Hash ...
Message-Id: <3dbb203d.4049358@news.erols.com>
"Thomas Dehn" <thomas-usenet@arcor.de> wrote:
: "Desmond Coughlan" <pasdespam_desmond@zeouane.org> wrote:
: > {
: > my %family_colouring = {
: > sister1 => "brown",
: > father => "grey",
: > mother => "grey",
: > sister2 => "blonde",
: > moi => "brown",};
: >
: > $test_member = $family_colouring{"sister1"};
:
: Apart from the comments others have already made,
: I doubt that "sister1" will be interpreted as
: the unquoted string sister 1 to which you assigend the value "brown".
The fat comma, => , automatically considers a bareword left operand as
a string. Quoting 'sister1' there is not necessary.
Nor does it have to be quoted as a hash key in the subsequent
statement, for that matter.
$test_member = $family_colouring{sister1};
------------------------------
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 4033
***************************************