[16047] in Perl-Users-Digest
Perl-Users Digest, Issue: 3459 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jun 23 00:05:26 2000
Date: Thu, 22 Jun 2000 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)
Message-Id: <961733110-v9-i3459@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Thu, 22 Jun 2000 Volume: 9 Number: 3459
Today's topics:
Re: Can you call a shell script from Perl? (Gary E. Ansok)
changing words within a file <theborg@usa.com>
Re: changing words within a file (Eric Bohlman)
Re: Creating a cause from information. malverian@my-deja.com
Re: Date::Manip can't handle Arizona Time zone? <jhelman@wsb.com>
Re: defined() <dan@tuatha.sidhe.org>
Re: eof for sendmail .. <rootbeer@redcat.com>
Re: Good Win32 Perl books for UNIX Perl programme? <Jonathan.L.Ericson@jpl.nasa.gov>
HELP PLEASE IM NEW cass_x@my-deja.com
How could I set Session ID for Browser without cookie? <ya_hsiung@ms2.url.com.tw>
Re: One Way ANOVA <aneely@softouch.on.ca>
Re: perl / win32 and threads <dan@tuatha.sidhe.org>
Re: Question on ARGV <Jonathan.L.Ericson@jpl.nasa.gov>
Re: Simple Reg Expression Question <kennylim@techie.com>
Simple regular expression question <kennylim@techie.com>
Re: Simple regular expression question (Eric Bohlman)
Re: Simple regular expression question <ivoz@starmail.com>
Re: Simple regular expression question <jhelman@wsb.com>
Re: Simple regular expression question <kennylim@techie.com>
SSL Post Method <tulit.nospam@nospam-rzsoft.com>
Re: strict and @ISA <aperrin@famine.DEMOG.Berkeley.EDU>
Re: use of eval and strict does not correctly set $@ <jhelman@wsb.com>
Re: Why cant a cgi and module use the same library? <jhelman@wsb.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 23 Jun 2000 03:34:16 GMT
From: ansok@alumni.caltech.edu (Gary E. Ansok)
Subject: Re: Can you call a shell script from Perl?
Message-Id: <8iulro$pev@gap.cco.caltech.edu>
In article <8iqm1s$98o$1@nnrp1.deja.com>, <fperkins@my-deja.com> wrote:
>Why won't this execute test.sh via the browser?
>
>$test = `test.sh`;
>
>Is it that "nobody" does not permissions to run shell scripts? Or
>should I be calling it a different way?
It may be that "nobody" does not have permission to run any shell script.
It may be that the permissions on "test.sh" do not allow "nobody" to run it.
It may be that "test.sh" is not in the PATH when run in the browser
(try giving the full path to test.sh)
It may be that there is some other error that just looks like test.sh
is not being executed -- you didn't tell us what error message
(if any), you saw, or give us a complete script.
Without more information, it's hard to be more helpful than that,
but I hope I've given you a few ideas of things to check out.
-- Gary
"I can call shell scripts from Perl!"
"Why so can I, and so can any man.
But will they run when you do call them?"
------------------------------
Date: Fri, 23 Jun 2000 01:37:20 GMT
From: borg <theborg@usa.com>
Subject: changing words within a file
Message-Id: <3952BF68.A20F6E01@usa.com>
I am often required to change words within a file.
I usually use:
perl -pe 's/oldword/newword/g' filename > newfile
My question is: If I have a whole list of files in the same dir where I
want to change the same word in each file is there an adaptation of this
systax I could use?
thanks,
Peter
------------------------------
Date: 23 Jun 2000 01:52:13 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: changing words within a file
Message-Id: <8iufsd$3b1$3@slb7.atl.mindspring.net>
borg (theborg@usa.com) wrote:
: I am often required to change words within a file.
:
: I usually use:
:
: perl -pe 's/oldword/newword/g' filename > newfile
:
: My question is: If I have a whole list of files in the same dir where I
: want to change the same word in each file is there an adaptation of this
: systax I could use?
perl -pi.bak -e 's/oldword/newword/g' file1 file2 wfile*
perldoc perlrun for more information on the -i switch.
------------------------------
Date: Fri, 23 Jun 2000 01:43:32 GMT
From: malverian@my-deja.com
Subject: Re: Creating a cause from information.
Message-Id: <8iufc1$36d$1@nnrp1.deja.com>
> Using $_ for your records also makes regex tests much nicer since they
> use $_ as default data, so you'll go /blah/ in stead of $data
>=~ /blah/
Thankya thankya =)
But why wouldn't this have the same loss of data that was mentioned if
I were to use $data? That's my main concern now.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Fri, 23 Jun 2000 02:27:04 GMT
From: Jeff Helman <jhelman@wsb.com>
Subject: Re: Date::Manip can't handle Arizona Time zone?
Message-Id: <3952CB55.E65B11D9@wsb.com>
bduellnca@my-deja.com wrote:
>
> I ran into this problem. Look in your Manip.pm file for $Cnf{"TZ"} and
> make it $Cnf{"TZ"}='MST7';
>
Just a question: Did you send a note of this to the module's author?
If I recall correctly, Indiana also is smart enough not to worry about
daylight savings time. CPAN lists the author as Sullivan Beck
(sbeck@cise.ufl.edu).
JH
------------------------------
Date: Fri, 23 Jun 2000 02:51:56 GMT
From: Dan Sugalski <dan@tuatha.sidhe.org>
Subject: Re: defined()
Message-Id: <ghA45.9026$Zg4.27697@news1.rdc1.ct.home.com>
Jakob Schmidt <sumus@aut.dk> wrote:
> "Brendon Caligari" <bcaligari@shipreg.com> writes:
>> what's the use of writing:
>> while (defined($strIn = <STDIN>)) {
>> instead?
> One reason I can think of is the case where $/ is set to something that
> evaluates to false in a test. Like '0'. If you have several zeros in a
> row in the input file then while( $strIn = <STDIN> ) would stop, while
> while (defined($strIn = <STDIN>)) would continue.
The other places you can run into trouble is if you're using tied
filehandles, or you've got $/ set to \1 and are reading in one character
at a time and thus might get a plain '0'.
Otherwise you'll get back a value with a trailing newline, so it'll never
evaluate to false.
Dan
------------------------------
Date: Thu, 22 Jun 2000 18:42:25 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: eof for sendmail ..
Message-Id: <Pine.GSO.4.10.10006221841510.4312-100000@user2.teleport.com>
On 22 Jun 2000, Chris Sorensen wrote:
> would someone please tell me the EOF command for sendmail ?
Perhaps you intended to post this to a newsgroup about sendmail. Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Thu, 22 Jun 2000 19:02:25 -0700
From: Jon Ericson <Jonathan.L.Ericson@jpl.nasa.gov>
Subject: Re: Good Win32 Perl books for UNIX Perl programme?
Message-Id: <3952C531.C02551B1@jpl.nasa.gov>
ddui@iee.org wrote:
> I have already experience with Perl on UNIX. I'll have to use Perl on
> Windows. What is a good book to learn the differences between Win32 and
> UNIX.
>
> I was thinking to get O'Reilly "Learning Perl on Win32 Systems", but I
> have heard that it is much like "Learning Perl" (the llama book), not
> very Win32 specific and therefore not great for someone that knows Perl
> already.
The bad news is that I'm not going to answer your question. The good
news is that you probably will never need a book specifically written
for perl on Windows. To quote from perlport:
Nearly all of Perl already *is* portable
Don't be fooled into thinking that it is hard to create portable
Perl code. It isn't. Perl tries its level-best to bridge the gaps
between what's available on different platforms, and all the means
available to use those features. Thus almost all Perl code runs on
any machine without modification. But there are some significant
issues in writing portable code, and this document is entirely about
those issues.
Jon
--
Knowledge is that which remains when what is
learned is forgotten. - Mr. King
------------------------------
Date: Fri, 23 Jun 2000 03:18:05 GMT
From: cass_x@my-deja.com
Subject: HELP PLEASE IM NEW
Message-Id: <8iukt4$6ph$1@nnrp1.deja.com>
HI All
I am having a problem with a script i have that sort of acts like a web
browser. This script will parse an HTML page for the expressions i
enter and write the output to an HTML doc on my hard drive. This works
on all sites except the ones who ask for cookies. Does anyone know how
to return a cookie via a Perl script ?? I already have the cookie i
need to log on to the site, is there any way to connect the cookie file
generated by Netscape to my Perl script ??
Any help would be greatly appreciated !!
Thanks in advance
Cass
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Fri, 23 Jun 2000 11:50:24 +0800
From: "news" <ya_hsiung@ms2.url.com.tw>
Subject: How could I set Session ID for Browser without cookie?
Message-Id: <8iumlb$lam@netnews.hinet.net>
Could any nice people tell me how could I set Session ID for different user
like using ASP without cookie?
please e-mail me.
------------------------------
Date: Fri, 23 Jun 2000 02:50:33 GMT
From: Amer Neely <aneely@softouch.on.ca>
Subject: Re: One Way ANOVA
Message-Id: <3952D05C.65B488DF@softouch.on.ca>
Colby Hansen wrote:
>
> I'm looking for a way to calculate one way ANOVA p-vals. CPAN is very
> limited as far as statistics modules go. Does anyone know where I might be
> able to find an existing module or an algorithm I can use to create my own?
> Thanks!
Try these:
http://hotspur.psych.yorku.ca/SCS/Online/power/power.pl.txt
http://www.statsoft.com/textbook/stathome.html
--
Amer Neely aneely@softouch.on.ca
Softouch Information Services: http://www.softouch.on.ca/
Research Central: http://www.softouch.on.ca/rc/
"There was a time when I thought I should be like everyone else.
Then there was a time when I thought everyone else should be like me.
Now I just think." - Amer Neely
------------------------------
Date: Fri, 23 Jun 2000 02:50:09 GMT
From: Dan Sugalski <dan@tuatha.sidhe.org>
Subject: Re: perl / win32 and threads
Message-Id: <BfA45.9025$Zg4.27697@news1.rdc1.ct.home.com>
Dan Harasty <harasty@my-deja.com> wrote:
> In article <8iqove$8k8$1@exnews.swisscom.com>,
> "philippe simonet" <philippe.simonet@swisscom.com> wrote:
>> Are threads implemented with the activestate version of perl 5.6?
> OK -- some digging around at "bugs.activestate.com/ActivePerl" reveals
> this (full text below): there is a "new" threading model, which
> activestate does not *yet* support.
They do, actually--it's what the Win32 fork emulation uses. There's just
no other way to use it at the moment.
> This is a real let-down considering the documentation with 5.6.0 for
> threads clearly says "Supported Plaforms: Windows".
Sure. You do need to rebuild perl with the threading code enabled, though.
Dan
------------------------------
Date: Thu, 22 Jun 2000 19:16:10 -0700
From: Jon Ericson <Jonathan.L.Ericson@jpl.nasa.gov>
Subject: Re: Question on ARGV
Message-Id: <3952C86A.E40E0163@jpl.nasa.gov>
peter_5575@my-deja.com wrote:
> I am new to perl and am having problems with command line arguments using the
> array @ARGV. I have been reading the book "Learning Perl on win32 systems and
> have typed in some of the examples using @ARGV to get command line input, but
> the array remains empty. I was wondering if anyone has run into this problem?
> Are there any options when compiling perl that enable or disable this? Any
> ideas would be appreciated.
What does this command do for you:
C:\> perl -e "print @ARGV" hello
hello
If you get different results, there is something seriously wrong with
your system. Otherwise, you are going to have to post code before
anyone will be able to help you.
Jon
--
Knowledge is that which remains when what is
learned is forgotten. - Mr. King
------------------------------
Date: Fri, 23 Jun 2000 01:50:02 GMT
From: "Kenny Lim" <kennylim@techie.com>
Subject: Re: Simple Reg Expression Question
Message-Id: <enz45.22388$ds.644725@newsread2.prod.itd.earthlink.net>
Thanks for the pointers !
Kenny-
"Kenny Lim" <kennylim@techie.com> wrote in message
news:sd545.23413$FC6.535682@newsread1.prod.itd.earthlink.net...
> Hi All,
>
> I am trying to convert a given ID to hexa-decimal format
> and would like to know if there is a simpler method opposed to
> what I currently have.
>
> also..
>
> (Q) How do we store the hex id generated into an array instead of
> a filehandle. When I attempt to print the new hexadecimal id
> into an array, I get the following result - ARRAY(0x8b92214)
> instead of the converted hexadecimal value when printing it out.
>
>
> Id : DA86E130-470E-11D4-9F14-0080ADC93510
>
> Hexadecimal : 0xDA86E130, 0x470E, 0x11D4, 0x9F, 0x14, 0x00, 0x80, 0xAD,
> 0xC9, 0x35, 0x10
>
> #===============
> #snippets of my code.
> #===============
>
> my $ID;
> $ID = `ETGuidGen`; <--This will generate a new unique id each them is
> executed.
> print "$ID\n";
>
> open (LOAD2, "> hexid2.txt") or die "Could not open hexid.txt: $!";
> <---how to store the converted format into an array
>
> and be printed out. I tried (open LOAD2, "> \@hexid")
>
> but it did not work. (See below for the result)
>
> print LOAD2 "0x" . substr($ID, 1, 8) . ", ";
> print LOAD2 "0x" . substr($ID, 10, 4). ", ";
> print LOAD2 "0x" . substr($ID, 15, 4). ", ";
> print LOAD2 "0x" . substr($ID, 20, 2). ", ";
> print LOAD2 "0x" . substr($ID, 22, 2). ", ";
> print LOAD2 "0x" . substr($ID, 25, 2). ", ";
> print LOAD2 "0x" . substr($ID, 27, 2). ", ";
> print LOAD2 "0x" . substr($ID, 29, 2). ", ";
> print LOAD2 "0x" . substr($ID, 31, 2). ", ";
> print LOAD2 "0x" . substr($ID, 33, 2). ", ";
> print LOAD2 "0x" . substr($ID, 35, 2);
>
> Result from the hexid2.txt file.
>
> 0xDA86E130, 0x470E, 0x11D4, 0x9F, 0x14, 0x00, 0x80, 0xAD, 0xC9, 0x35, 0x10
>
> Result from the \@hexid array.
>
> ARRAY(0x8b92214)
>
> Any advise would be appreaciated. Thanks.
>
> Kenny-
>
>
>
>
>
>
>
>
>
>
>
>
------------------------------
Date: Fri, 23 Jun 2000 01:46:26 GMT
From: "Kenny Lim" <kennylim@techie.com>
Subject: Simple regular expression question
Message-Id: <Sjz45.22375$ds.644555@newsread2.prod.itd.earthlink.net>
Hi All,
I have a simple question here :
I have the following id's that are stored in result.txt files.
{B2165B0A-9D18-11d3-BA27-006008AF680E}|{BBBDDE80-488B-11D4-85D7-00105AE3A355
}
{B2165B09-9D18-11d3-BA27-006008AF680E}|{BB9623A0-488B-11D4-85D7-00105AE3A355
}
{308C177E-9BAA-11d3-9465-005004D9BC31}|{BB9C4060-488B-11D4-85D7-00105AE3A355
}
{B2B98458-9D15-11d3-9466-005004D9BC31}|{BBAD0F70-488B-11D4-85D7-00105AE3A355
}
{B2165B0A-9D18-11d3-BA27-006008AF680E}|{BBBDDE80-488B-11D4-85D7-00105AE3A355
}
My objective here is to be able to separate and parsed both the contents in
{a..} | {b..} to the following :
ie.
{B2165B0A-9D18-11d3-BA27-006008AF680E}|{BBBDDE80-488B-11D4-85D7-00105AE3A355
}
$search = {B2165B0A-9D18-11d3-BA27-006008AF680E}
$replace = {BBBDDE80-488B-11D4-85D7-00105AE3A355}
So far, I am only able to retrieve the 1st category of the id contents and
not the second.
Snippets of my code enclosed :
#=========================================================================
open (INIT, "<report.txt") or die "Could not open $orig: $!";
while (<INIT>)
{
if
(m/{([\w]{8})+\-([\w]{4})+\-([\w]{4})+\-([\w]{4})+\-([\w]{12})}|{([\w]{8})+\
-([\w]{4})+\-([\w]{4})+\-([\w]{4})+\-([\w]{12})}/ig)
{
#print "$_\n";
$search = "{$1-$2-$3-$4-$5}";
print "$search\n";
$replace = "{$6-$7-$8-$9-$10}";
print "$replace\n";
}
};
#==========================================================================
The output of my results are the following :
$ perl e3.pl
{B2165B09-9D18-11d3-BA27-006008AF680E}
{----}
{308C177E-9BAA-11d3-9465-005004D9BC31}
{----}
{B2B98458-9D15-11d3-9466-005004D9BC31}
{----}
{B2165B0A-9D18-11d3-BA27-006008AF680E}
{----}
Can anyone provide me a pointer as to how I can retrieve the second category
of the id contents ?
Any advise would be greatly appreciated. Thanks.
Kenny-
------------------------------
Date: 23 Jun 2000 01:57:29 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: Simple regular expression question
Message-Id: <8iug69$3b1$4@slb7.atl.mindspring.net>
Kenny Lim (kennylim@techie.com) wrote:
:
: Hi All,
:
: I have a simple question here :
:
: I have the following id's that are stored in result.txt files.
:
: {B2165B0A-9D18-11d3-BA27-006008AF680E}|{BBBDDE80-488B-11D4-85D7-00105AE3A355
: }
[snip]
:
: My objective here is to be able to separate and parsed both the contents in
: {a..} | {b..} to the following :
:
: ie.
:
: {B2165B0A-9D18-11d3-BA27-006008AF680E}|{BBBDDE80-488B-11D4-85D7-00105AE3A355
: }
:
: $search = {B2165B0A-9D18-11d3-BA27-006008AF680E}
: $replace = {BBBDDE80-488B-11D4-85D7-00105AE3A355}
:
: So far, I am only able to retrieve the 1st category of the id contents and
: not the second.
:
: Snippets of my code enclosed :
:
: #=========================================================================
:
: open (INIT, "<report.txt") or die "Could not open $orig: $!";
: while (<INIT>)
: {
:
: if
: (m/{([\w]{8})+\-([\w]{4})+\-([\w]{4})+\-([\w]{4})+\-([\w]{12})}|{([\w]{8})+\
: -([\w]{4})+\-([\w]{4})+\-([\w]{4})+\-([\w]{12})}/ig)
Your problem is that you've forgotten to escape your '|'.
: {
: #print "$_\n";
: $search = "{$1-$2-$3-$4-$5}";
: print "$search\n";
: $replace = "{$6-$7-$8-$9-$10}";
: print "$replace\n";
:
: }
: };
But why are you splitting your IDs up into their subparts only to join
them back together?
------------------------------
Date: Fri, 23 Jun 2000 05:10:45 +0300
From: "Ivo Zdravkov" <ivoz@starmail.com>
Subject: Re: Simple regular expression question
Message-Id: <3952c6d4_1@news.nwlink.com>
"Kenny Lim" <kennylim@techie.com> wrote in message
news:Sjz45.22375$ds.644555@newsread2.prod.itd.earthlink.net...
>
> Hi All,
>
> I have a simple question here :
>
> I have the following id's that are stored in result.txt files.
>
>
{B2165B0A-9D18-11d3-BA27-006008AF680E}|{BBBDDE80-488B-11D4-85D7-00105AE3A355
> }
>
{B2165B09-9D18-11d3-BA27-006008AF680E}|{BB9623A0-488B-11D4-85D7-00105AE3A355
> }
>
{308C177E-9BAA-11d3-9465-005004D9BC31}|{BB9C4060-488B-11D4-85D7-00105AE3A355
> }
>
{B2B98458-9D15-11d3-9466-005004D9BC31}|{BBAD0F70-488B-11D4-85D7-00105AE3A355
> }
>
{B2165B0A-9D18-11d3-BA27-006008AF680E}|{BBBDDE80-488B-11D4-85D7-00105AE3A355
> }
>
> My objective here is to be able to separate and parsed both the contents
in
> {a..} | {b..} to the following :
>
> ie.
>
>
{B2165B0A-9D18-11d3-BA27-006008AF680E}|{BBBDDE80-488B-11D4-85D7-00105AE3A355
> }
>
> $search = {B2165B0A-9D18-11d3-BA27-006008AF680E}
> $replace = {BBBDDE80-488B-11D4-85D7-00105AE3A355}
>
> So far, I am only able to retrieve the 1st category of the id contents and
> not the second.
>
> Snippets of my code enclosed :
>
> #=========================================================================
>
> open (INIT, "<report.txt") or die "Could not open $orig: $!";
> while (<INIT>)
> {
>
> if
>
(m/{([\w]{8})+\-([\w]{4})+\-([\w]{4})+\-([\w]{4})+\-([\w]{12})}|{([\w]{8})+\
> -([\w]{4})+\-([\w]{4})+\-([\w]{4})+\-([\w]{12})}/ig)
try this:
{(\w{8})-(\w{4})-(\w{4})-(\w{4})-\w{12}}\|{(\w{8})-(\w{4})-(\w{4})-(\w{4})-(
\w{12})}
> {
> #print "$_\n";
> $search = "{$1-$2-$3-$4-$5}";
> print "$search\n";
> $replace = "{$6-$7-$8-$9-$10}";
> print "$replace\n";
>
> }
> };
>
>
#==========================================================================
>
> The output of my results are the following :
>
> $ perl e3.pl
> {B2165B09-9D18-11d3-BA27-006008AF680E}
> {----}
> {308C177E-9BAA-11d3-9465-005004D9BC31}
> {----}
> {B2B98458-9D15-11d3-9466-005004D9BC31}
> {----}
> {B2165B0A-9D18-11d3-BA27-006008AF680E}
> {----}
>
> Can anyone provide me a pointer as to how I can retrieve the second
category
> of the id contents ?
>
> Any advise would be greatly appreciated. Thanks.
>
> Kenny-
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
------------------------------
Date: Fri, 23 Jun 2000 02:31:21 GMT
From: Jeff Helman <jhelman@wsb.com>
Subject: Re: Simple regular expression question
Message-Id: <3952CC53.55D00F48@wsb.com>
I'm not entirely sure what you want, but if I read this correctly your
script is not matching the data after the pipe (|) symbol. The reason
for that is in RegEx language, the pipe symbol indicates a choice
between several alternatives.
Escape your | in the regular expression (i.e. make it \| instead of |)
and that will (probably) fix the problem. I'd test it but it seems like
a good bit of work and it's bed time. :)
Hope this helps.
JH
Kenny Lim wrote:
>
> Hi All,
>
> I have a simple question here :
>
> I have the following id's that are stored in result.txt files.
>
> {B2165B0A-9D18-11d3-BA27-006008AF680E}|{BBBDDE80-488B-11D4-85D7-00105AE3A355
> }
> {B2165B09-9D18-11d3-BA27-006008AF680E}|{BB9623A0-488B-11D4-85D7-00105AE3A355
> }
> {308C177E-9BAA-11d3-9465-005004D9BC31}|{BB9C4060-488B-11D4-85D7-00105AE3A355
> }
> {B2B98458-9D15-11d3-9466-005004D9BC31}|{BBAD0F70-488B-11D4-85D7-00105AE3A355
> }
> {B2165B0A-9D18-11d3-BA27-006008AF680E}|{BBBDDE80-488B-11D4-85D7-00105AE3A355
> }
>
> My objective here is to be able to separate and parsed both the contents in
> {a..} | {b..} to the following :
>
> ie.
>
> {B2165B0A-9D18-11d3-BA27-006008AF680E}|{BBBDDE80-488B-11D4-85D7-00105AE3A355
> }
>
> $search = {B2165B0A-9D18-11d3-BA27-006008AF680E}
> $replace = {BBBDDE80-488B-11D4-85D7-00105AE3A355}
>
> So far, I am only able to retrieve the 1st category of the id contents and
> not the second.
>
> Snippets of my code enclosed :
>
> #=========================================================================
>
> open (INIT, "<report.txt") or die "Could not open $orig: $!";
> while (<INIT>)
> {
>
> if
> (m/{([\w]{8})+\-([\w]{4})+\-([\w]{4})+\-([\w]{4})+\-([\w]{12})}|{([\w]{8})+\
> -([\w]{4})+\-([\w]{4})+\-([\w]{4})+\-([\w]{12})}/ig)
> {
> #print "$_\n";
> $search = "{$1-$2-$3-$4-$5}";
> print "$search\n";
> $replace = "{$6-$7-$8-$9-$10}";
> print "$replace\n";
>
> }
> };
>
> #==========================================================================
>
> The output of my results are the following :
>
> $ perl e3.pl
> {B2165B09-9D18-11d3-BA27-006008AF680E}
> {----}
> {308C177E-9BAA-11d3-9465-005004D9BC31}
> {----}
> {B2B98458-9D15-11d3-9466-005004D9BC31}
> {----}
> {B2165B0A-9D18-11d3-BA27-006008AF680E}
> {----}
>
> Can anyone provide me a pointer as to how I can retrieve the second category
> of the id contents ?
>
> Any advise would be greatly appreciated. Thanks.
>
> Kenny-
------------------------------
Date: Fri, 23 Jun 2000 02:49:33 GMT
From: "Kenny Lim" <kennylim@techie.com>
Subject: Re: Simple regular expression question
Message-Id: <1fA45.28414$FC6.679439@newsread1.prod.itd.earthlink.net>
Silly Me ! That resolved the problem. Thanks for the help !
{A81D7F82-9BA2-11d3-9465-005004D9BC31}|{B20D7F82-9BA2-11d3-9465005004D9BC31}
{A81D7F82-9BA2-11d3-9465-005004D9BC31}
{B20D7F82-9BA2-11d3-9465-005004D9BC31}
Kenny-
"Kenny Lim" <kennylim@techie.com> wrote in message
news:Sjz45.22375$ds.644555@newsread2.prod.itd.earthlink.net...
>
> Hi All,
>
> I have a simple question here :
>
> I have the following id's that are stored in result.txt files.
>
>
{B2165B0A-9D18-11d3-BA27-006008AF680E}|{BBBDDE80-488B-11D4-85D7-00105AE3A355
> }
>
{B2165B09-9D18-11d3-BA27-006008AF680E}|{BB9623A0-488B-11D4-85D7-00105AE3A355
> }
>
{308C177E-9BAA-11d3-9465-005004D9BC31}|{BB9C4060-488B-11D4-85D7-00105AE3A355
> }
>
{B2B98458-9D15-11d3-9466-005004D9BC31}|{BBAD0F70-488B-11D4-85D7-00105AE3A355
> }
>
{B2165B0A-9D18-11d3-BA27-006008AF680E}|{BBBDDE80-488B-11D4-85D7-00105AE3A355
> }
>
> My objective here is to be able to separate and parsed both the contents
in
> {a..} | {b..} to the following :
>
> ie.
>
>
{B2165B0A-9D18-11d3-BA27-006008AF680E}|{BBBDDE80-488B-11D4-85D7-00105AE3A355
> }
>
> $search = {B2165B0A-9D18-11d3-BA27-006008AF680E}
> $replace = {BBBDDE80-488B-11D4-85D7-00105AE3A355}
>
> So far, I am only able to retrieve the 1st category of the id contents and
> not the second.
>
> Snippets of my code enclosed :
>
> #=========================================================================
>
> open (INIT, "<report.txt") or die "Could not open $orig: $!";
> while (<INIT>)
> {
>
> if
>
(m/{([\w]{8})+\-([\w]{4})+\-([\w]{4})+\-([\w]{4})+\-([\w]{12})}|{([\w]{8})+\
> -([\w]{4})+\-([\w]{4})+\-([\w]{4})+\-([\w]{12})}/ig)
> {
> #print "$_\n";
> $search = "{$1-$2-$3-$4-$5}";
> print "$search\n";
> $replace = "{$6-$7-$8-$9-$10}";
> print "$replace\n";
>
> }
> };
>
>
#==========================================================================
>
> The output of my results are the following :
>
> $ perl e3.pl
> {B2165B09-9D18-11d3-BA27-006008AF680E}
> {----}
> {308C177E-9BAA-11d3-9465-005004D9BC31}
> {----}
> {B2B98458-9D15-11d3-9466-005004D9BC31}
> {----}
> {B2165B0A-9D18-11d3-BA27-006008AF680E}
> {----}
>
> Can anyone provide me a pointer as to how I can retrieve the second
category
> of the id contents ?
>
> Any advise would be greatly appreciated. Thanks.
>
> Kenny-
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
------------------------------
Date: Fri, 23 Jun 2000 03:37:17 GMT
From: "Tarun Tuli" <tulit.nospam@nospam-rzsoft.com>
Subject: SSL Post Method
Message-Id: <NXA45.22328$ef6.287332@news1.rdc1.ab.home.com>
Hi, I was wondering if anyone knew how I could possibly post a form
(automatically) using perl. The form that I am posting to only supports a
POST method. As an added twist, it also only allows SSL connections.
Any advice on how to tackle this one would be greatly appriciated.
Thanks.
------------------------------
Date: 22 Jun 2000 18:30:48 -0700
From: Andrew Perrin - Demography <aperrin@famine.DEMOG.Berkeley.EDU>
Subject: Re: strict and @ISA
Message-Id: <u5kem5pyyif.fsf@famine.DEMOG.Berkeley.EDU>
I appreciate all the responses, which are generally in the class of
"the same way you'd get rid of the error message for any other global
variable," e.g., use base, our(), or use vars.
However, the reason I *wrote* the message was basically along the
lines of Bart Lateur's answer: @ISA behaves much like other built-in
variables in perl, such as $_, $0, etc., etc., in that its value
determines built-in behavior of the language. But setting other
built-in variables does not cause an error under use strict, even when
they have not been initialized:
aperrin@famine ~> perl -Mstrict -e'$_ = q[foo]; print qq[$_\n];'
foo
That seems an inconsistency.
--
---------------------------------------------------------------------
Andrew J. Perrin - aperrin@demog.berkeley.edu - NT/Unix Admin/Support
Department of Demography - University of California at Berkeley
2232 Piedmont Avenue #2120 - Berkeley, California, 94720-2120 USA
http://demog.berkeley.edu/~aperrin --------------------------SEIU1199
------------------------------
Date: Fri, 23 Jun 2000 02:35:45 GMT
From: Jeff Helman <jhelman@wsb.com>
Subject: Re: use of eval and strict does not correctly set $@
Message-Id: <3952CD5E.637B08AC@wsb.com>
dfdf wrote:
>
{SNIP}
> #odd.pl
> $foo = 'use strict; $SIG{PIPE} = Plumber';
> eval $foo;
> print "Error $@ if $@;
>
> If you ran this code, you wil notice that the $SIG{PIPE} =
> Plumber; code generates a strict related error of
>
> Bareword "foo" not allowed while "strict subs" in use at (eval
> 1) line 1.
>
> However it is not set to $@. Any thoughts?
If I recall correctly, using the strict pragma forces perl to check for
violations at compile time (vs. at run-time). Thus, the eval never runs
because your script dies during compile. Thus $@ is never set.
Incidently, I should hope that the last line of your code snippet is a
syntax error. :)
Hope this helps,
JH
------------------------------
Date: Fri, 23 Jun 2000 02:21:22 GMT
From: Jeff Helman <jhelman@wsb.com>
Subject: Re: Why cant a cgi and module use the same library?
Message-Id: <3952C9FF.5E4404C5@wsb.com>
glchy wrote:
>
> bart.lateur@skynet.be (Bart Lateur) wrote:
> >Jeff Helman wrote:
> >
> >> When the compiler gets to the second require statement (in
> >>A.cgi), it skips it since that file has already been loaded.
> >
> >but into the wrong package.
> >
> >That's why "import" was invented.
> >
> >You can get around it by putting the require statement before
> the
> >package declaration, and assume that what you need from the
> library file
> >is in package main (qualify the sub names). If you're paranoid,
> you can
> >even put "package main;" in front of it.
> >
> >--
> > Bart.
> >
> >
> Ok thanks guys,
> i was suspecting that it had something to do with loading in a
> namespace and no re-loading process permitted (btw can we bypass
> that n force Perl to reload the same lib but in a different
> namespace?).
That's the import() method that Bart was talking about (but that still
requires making modules of your objects. Take a look that...oh,
hell...the Exporter.pm code as well as perlfunc in the use(?) section
(sorry, don't have the docs handy at the moment).
> Jeff, your solution works but is very painful as i have a few
> libs (cookie-lib, cgi-lib.pl, my own lib files). Also tt would
> mean any time later i need to convert potential useful perl libs
> into pms.
Believe me when I say I feel your pain. :) Even though I preached
modularizing your code, I have been known on occasion (OK, frequently)
to just explicitly specify the packages in the modules and write a quick
search-and-replace script to update all files that use that module. If
the modules were well written and don't use global variables much (since
you mentioned cgi-lib, you're out of luck here), all you have to tweak
are the subroutine names.
One other option (and please don't flame me for this): If there are
only a handful of libraries that you use that are subject to this
problem, here is the quick fix (and this is decidedly below optimal).
Make copies of the files in question and name 'em cgi-lib1.pl,
cgi-lib2.pl, etc. Then, in your modules, require one of newly created
files. This way you can import with abandon, but beware that you will
be cluttering the heck out of all of your namespaces. If you're on
Unix, you might even get away with including symbolic links and not even
making copies, but I'm not sure about that one.
Good luck,
JH
--
Jeff Helman
Custodian to a bunch of really old (and poorly coded libraries) and not
bitter in the #@$%!@#$@$ least. :)
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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 V9 Issue 3459
**************************************