[19165] in Perl-Users-Digest
Perl-Users Digest, Issue: 1360 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jul 23 14:06:11 2001
Date: Mon, 23 Jul 2001 11:05:09 -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: <995911508-v10-i1360@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Mon, 23 Jul 2001 Volume: 10 Number: 1360
Today's topics:
Re: Appanding to hash_key_value (Nipa)
Re: Appanding to hash_key_value (Anno Siegel)
Re: Appanding to hash_key_value (Nipa)
Re: Appanding to hash_key_value ctcgag@hotmail.com
Re: Appanding to hash_key_value ctcgag@hotmail.com
Re: Appanding to hash_key_value <mbudash@sonic.net>
Re: Can I <!--include files ??? <dcs@ntlworld.com>
Re: cant perl get better??? <jeff@vpservices.com>
Re: converting numeric-string to integer doesn't work f (Garry)
Escaped period! Someone apprehend it! <ReplyToTheGroup@DoNotEmailMe.Com>
Re: Escaped period! Someone apprehend it! <holland@origo.ifa.au.dk>
Re: Escaped period! Someone apprehend it! (Eric Bohlman)
fork / exec with Win NT Server <Georg.Vassilopulos@SoftwareAG.de>
Re: Getting error on Oracle CLOB insert using PERL DBI <rachel@lspace.org>
Re: Help replacing strings needed. <mbudash@sonic.net>
Re: Help replacing strings needed. <marshall@chezmarshall.com>
Re: HELP WITH PERLDAP!!!!!!!!! <turnerj@lapdog.lmtas.lmco.com>
Re: I found sprintf - is there a sscanf? <arifsaha@yahoo.com>
Re: Large Filesystem Scrubbers (Eric Bohlman)
Re: Regular Expression Experts ctcgag@hotmail.com
Re: Remote updating of my website <Deneb.Pettersson@lmf.ericsson.se>
Re: Sendmail with Win32 <hillr@ugs.com>
Re: Sendmail with Win32 <andras@mortgagestats.com>
Re: Sorry for the multiple posts <tom.melly@ccl.com>
use CGI qw(:standard) <todd@mrnoitall.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 23 Jul 2001 08:07:43 -0700
From: npatel@webley.com (Nipa)
Subject: Re: Appanding to hash_key_value
Message-Id: <24d1a4c3.0107230707.cd7eabf@posting.google.com>
Thanks Bob,
Thanks for the explaination on hash $key and $value. So if i
understand it correctly, when i do 'if($formdata{$key})' i am checking
if value exist for particular key. I am not checking if the $key it
self exist. right?
I have tried using the simple code you gave before posting the first
message.It quite didn't work.
this is what I did:
$formdata{$key} .= $value;
it somehow doesnt' work. it doesn't appand, but it overwrites the
first value.
And this hash is not a tied hash.(i really don't know how to use tied
hash anyways..)Oh, one another very simple questoin: i have seen this
expression 'perldoc -f somekeyword' a lot. As a newbi to perl, I am
not quite sure where to use this command. is it an acutal command??
Please feel free to provide any other info.
Thanks.
Nipa
Bob Walton <bwalton@rochester.rr.com> wrote in message news:<3B58F4ED.3AABC7C6@rochester.rr.com>...
> Nipa wrote:
> ...
> > here is my question: How do i append to an existing key's value in a
> > Hash
> > this is that the code looks like:
> > if($formdata{$key})
> The above line tests for a true value stored in a hash as the value
> corresponding to a key. If the value is 0, the empty string, or undef,
> the test will take the false branch. You want to use the exists
> function for this (see perldoc -f exists). But why are you doing this
> test in the first place?
> > {
> > $formdata{$key} .= "$value";
> > }
> > else { $fromdata{$key} = $value; }
> -----------^^
> You have two hashes here.
> >
> > now, the problem is in appanding the value to an existing 'key' value.
> > What I need to do is, if i find a key that already exist and appand to
> > it's value.
> >
> > One question would be, when I do ' if($formdata{$key}) ' does it mean
> > that i am checking the existance of a value or a key in a hash. I have
> No. It means you are testing for a true value stored in a hash under a
> key. As stated above, you want the "exists" function for this job.
> > also tried using 'join' function but the output it not what i want. it
> "join" joins array elements.
> > doesn't appand to the original value, rather it overwrites it. since
> > the original value (string) is quite long, I can see the over
> > writting.
> One question: would this be a tied hash tied to a dbm-type file
> implementation which has a limited length for values which you might be
> exceeding (not every dbm-type file implementation supports unlimited
> key/value lengths)? If so, you could get odd behavior. Or if the hash
> is tied to some other thing?
> ...
> > Nipa
> It should be quite simple:
>
> $formdata{$key}.=$value;
>
> ought to do the trick. There should be no need to test for the
> existence of a key or any other complicated mechanism.
------------------------------
Date: 23 Jul 2001 15:45:29 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Appanding to hash_key_value
Message-Id: <9jhgqp$bbb$1@mamenchi.zrz.TU-Berlin.DE>
According to Nipa <npatel@webley.com>:
Please don't slap your reply on top of the post you are replying to.
Put your comments after the (suitably trimmed) material you're
commenting.
> Thanks Bob,
>
> Thanks for the explaination on hash $key and $value. So if i
> understand it correctly, when i do 'if($formdata{$key})' i am checking
> if value exist for particular key.
Not even that. You are checking if the value is a boolean true value.
Some defined values like '' and 0 are false.
> I am not checking if the $key it
> self exist. right?
To check for the "existence" of a value, you'd explicitly have to check
for definedness:
if ( defined $formdata{$key} ) {
To check for existence of a key (as has probably been mentioned), use
if ( exists $formdata{$key} ) {
> I have tried using the simple code you gave before posting the first
> message.It quite didn't work.
> this is what I did:
> $formdata{$key} .= $value;
>
> it somehow doesnt' work. it doesn't appand, but it overwrites the
> first value.
Then something else is wrong. Are you sure you are using the exact
same key each time? Not only case matters, trailing whitespace
(linefeed?) spoils the game too.
[jeopardectomy]
Anno
------------------------------
Date: 23 Jul 2001 08:48:51 -0700
From: npatel@webley.com (Nipa)
Subject: Re: Appanding to hash_key_value
Message-Id: <24d1a4c3.0107230748.6c45fc02@posting.google.com>
Bob Walton <bwalton@rochester.rr.com> wrote in message news:<3B58F4ED.3AABC7C6@rochester.rr.com>...
Here is more elaborate explainations:
while($line = <LOG>)
{
($key, $value) = split(/:/, $line ,2);
$formdata{$key} = $value;
if(exists $formdata{$key}) { $formdata{$key} .= $value; }
else { $formdata{$key} = $value; }
}
if i print each key and value :
for the first time : key has correct value,
for the second time when try to appand to existed key is over wirtes
the first sotred value and put the second(new value) value.
Thanks
Nipa
> Nipa wrote:
> ...
> > here is my question: How do i append to an existing key's value in a
> > Hash
> > this is that the code looks like:
> > if($formdata{$key})
> The above line tests for a true value stored in a hash as the value
> corresponding to a key. If the value is 0, the empty string, or undef,
> the test will take the false branch. You want to use the exists
> function for this (see perldoc -f exists). But why are you doing this
> test in the first place?
> > {
> > $formdata{$key} .= "$value";
> > }
> > else { $fromdata{$key} = $value; }
> -----------^^
> You have two hashes here.
> >
> > now, the problem is in appanding the value to an existing 'key' value.
> > What I need to do is, if i find a key that already exist and appand to
> > it's value.
> >
> > One question would be, when I do ' if($formdata{$key}) ' does it mean
> > that i am checking the existance of a value or a key in a hash. I have
> No. It means you are testing for a true value stored in a hash under a
> key. As stated above, you want the "exists" function for this job.
> > also tried using 'join' function but the output it not what i want. it
> "join" joins array elements.
> > doesn't appand to the original value, rather it overwrites it. since
> > the original value (string) is quite long, I can see the over
> > writting.
> One question: would this be a tied hash tied to a dbm-type file
> implementation which has a limited length for values which you might be
> exceeding (not every dbm-type file implementation supports unlimited
> key/value lengths)? If so, you could get odd behavior. Or if the hash
> is tied to some other thing?
> ...
> > Nipa
> It should be quite simple:
>
> $formdata{$key}.=$value;
>
> ought to do the trick. There should be no need to test for the
> existence of a key or any other complicated mechanism.
------------------------------
Date: 23 Jul 2001 15:52:22 GMT
From: ctcgag@hotmail.com
Subject: Re: Appanding to hash_key_value
Message-Id: <20010723115222.937$T5@newsreader.com>
anno4000@lublin.zrz.tu-berlin.de (Anno Siegel) wrote:
> According to Nipa <npatel@webley.com>:
>
> > I have tried using the simple code you gave before posting the first
> > message.It quite didn't work.
> > this is what I did:
> > $formdata{$key} .= $value;
> >
> > it somehow doesnt' work. it doesn't appand, but it overwrites the
> > first value.
>
> Then something else is wrong. Are you sure you are using the exact
> same key each time? Not only case matters, trailing whitespace
> (linefeed?) spoils the game too.
My guess would be that his $value's have trailing \015, so it actually
does append, but when printed out on terminals expecting LFs, it looks like
it overwrites.
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service
------------------------------
Date: 23 Jul 2001 16:02:04 GMT
From: ctcgag@hotmail.com
Subject: Re: Appanding to hash_key_value
Message-Id: <20010723120204.075$rK@newsreader.com>
npatel@webley.com (Nipa) wrote:
>
> Here is more elaborate explainations:
> while($line = <LOG>)
> {
No chomp?
> ($key, $value) = split(/:/, $line ,2);
I'd "my" that
> $formdata{$key} = $value;
Well, this is dumb. You just blew away any previous value it had.
> if(exists $formdata{$key}) { $formdata{$key} .= $value; }
Of course it exists, you just created one line up.
> else { $formdata{$key} = $value; }
> }
>
> if i print each key and value :
> for the first time : key has correct value,
Are you sure it doesn't have the correct value repeated twice? First you
create it, then you append with the same value.
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service
------------------------------
Date: Mon, 23 Jul 2001 16:21:16 GMT
From: Michael Budash <mbudash@sonic.net>
Subject: Re: Appanding to hash_key_value
Message-Id: <mbudash-62E887.09212023072001@news.sonic.net>
In article <24d1a4c3.0107230748.6c45fc02@posting.google.com>,
npatel@webley.com (Nipa) wrote:
> Bob Walton <bwalton@rochester.rr.com> wrote in message
> news:<3B58F4ED.3AABC7C6@rochester.rr.com>...
>
> Here is more elaborate explainations:
> while($line = <LOG>)
> {
>
> ($key, $value) = split(/:/, $line ,2);
> $formdata{$key} = $value;
> if(exists $formdata{$key}) { $formdata{$key} .= $value; }
> else { $formdata{$key} = $value; }
> }
>
> if i print each key and value :
> for the first time : key has correct value,
> for the second time when try to appand to existed key is over wirtes
> the first sotred value and put the second(new value) value.
>
> Thanks
> Nipa
you're re-setting the value, THEN checking if it exists (which of course
it will - you just set it!), then appending it! try this:
while ($line = <LOG>) {
($key, $value) = split (/:/, $line, 2);
if (exists $formdata{$key}) {
$formdata{$key} .= $value;
}
else {
$formdata{$key} = $value;
}
}
hth-
--
Michael Budash ~~~~~~~~~~ mbudash@sonic.net
------------------------------
Date: Mon, 23 Jul 2001 16:32:22 +0100
From: "Terry" <dcs@ntlworld.com>
Subject: Re: Can I <!--include files ???
Message-Id: <XmX67.9692$Iz3.3010377@news2-win.server.ntlworld.com>
"Ben Kennedy" <bkennedy99@Home.com> wrote in message
news:gVU67.19717$EP6.4874282@news1.rdc2.pa.home.com...
>
> "Terry" <dcs@ntlworld.com> wrote in message
> news:8WA57.51314$WS4.7824947@news6-win.server.ntlworld.com...
> > "Ben Kennedy" <bkennedy99@Home.com> wrote in message
> > news:tLA57.3448$EP6.1146360@news1.rdc2.pa.home.com...
> >
> > Am I right in assuming that I wouldn't be able to METHOD="POST" to these
> > pages?
>
> Mason will transparently decode the form parameters for you, GET or POST -
> see http://www.masonhq.com Its not the easiest thing in the world to get
> set up, but if you are not a sysadmin type I would recommend using the
> apache toolbox (http://www.apachetoolbox.com/) to build your
> Apache+Mod_Perl - its pretty easy to use. Hope this helps --
Thanks for the info Ben :-)
Best wishes
Terry
>
> --Ben Kennedy
>
>
------------------------------
Date: Mon, 23 Jul 2001 08:06:26 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: cant perl get better???
Message-Id: <3B5C3D72.BE525E20@vpservices.com>
Aman Patel wrote:
>
> - In-built capability of dealing with hash-file databases (use DB_File), but
> no external module requirements.
If by external module you mean any Perl module that isn't in the
standard distribution, then I have no advice for you. Perl uses
modules, that's the way it works.
If by external module you mean Berkeley DB, and what you are looking for
is a perl/XS only way to use hash-file databases, then you may want to
consider my modules AnyData and DBD::AnyData which support tied -hash
and DBI/SQL interfaces to many different kinds of file formats. The
tied hash interface is pure perl (no XS) and does not require DBI.
--
Jeff
------------------------------
Date: 23 Jul 2001 09:02:11 -0700
From: garry_short@hotmail.com (Garry)
Subject: Re: converting numeric-string to integer doesn't work for me... help!
Message-Id: <bdcefd33.0107230802.29955859@posting.google.com>
"Beng" <benghua@NOSPAM.cyberworks.net.sg> wrote in message news:<3b5bc55a@news>...
> Hi guys,
>
> I am trying to write a perl script to crunch a series of BIG numbers from an
> array, and then perform arithmetic operations on them. Those BIG numbers are
> actually numeric-strings, and I need to convert these strings to integers
> first before I do the summing operation.
>
> Here's how my array (last 3 entries) looks like.... strings separated by a
> space :
>
> 9908 10075 77039256.797 5454961145466
> 9914 17547 468315.61 7006666186844
> 9975 17547 1782359.41 26710406712277
>
> I'm trying to convert the 3rd and 4th elements to integer. In my script, I
> have the following :
>
> for $newlist (@newlist) {
> ($src_as, $des_as, $pkts, $bytes) = split(/
> /,$newlist);
> $pkts = int($pkts);
> $bytes= int($bytes);
> print"pkts = $pkts, bytes = $bytes\n";
> }
>
> Ad the output from the script is :
>
> pkts = 77039, bytes = 5454961
> pkts = 4683, bytes = 7006666
> pkts = 17823, bytes = 26710406
>
> Notice how the result got truncated??
>
> Initially I thought it was because my numbers were too big. So I wrote the
> following testing script :
>
> $str = "17424473464653.72765";
> $y = int($str);
> print "Y = $y \n";
> print "Y * 9999 = $y*9999 \n";
>
> And the result was :
>
> Y = 17424473464653
> Y * 9999 = 17424473464653*9999
>
> Running perfectly fine on the testing script.... something which I don't
> understand why. Been thinking for days but still couldn't figure out what's
> wrong.
>
> Can anyone help me with this?? Or just give me some pointers to look into?
>
> Sorry for the long posting.
>
> Thanks for reading...
This works fine on my machine (even the for, which I was convinced
should be a foreach until I tried it).
Is this the actual code and data file? If not, I'd suggest posting
those for us to look at.
Regards,
Garry
------------------------------
Date: Mon, 23 Jul 2001 17:37:46 GMT
From: "Jay" <ReplyToTheGroup@DoNotEmailMe.Com>
Subject: Escaped period! Someone apprehend it!
Message-Id: <KhZ67.3944$LP2.416970@bgtnsc06-news.ops.worldnet.att.net>
Sorry for the pun in the subject. I had the following in a program.
if(/\d+\.?\d+/) {
print "OK!";
}
Now what I wanted was it to accept numbers which can be either whole numbers
or decimal numbers(hence the period). This doesn't work, though. It
accepts numbers alright, and anything else too. If I put it as /\d+\.\d+/
it works fine, but then the decimal is required(not what I wanted).
Shouldn't adding the ? make it so it accepts one or more numbers zero or one
decimal and one or more numbers? Obviously not, otherwise I wouldn't be
here. I appreciate any help.
Jay,
------------------------------
Date: 23 Jul 2001 19:52:08 +0200
From: Steve Holland <holland@origo.ifa.au.dk>
Subject: Re: Escaped period! Someone apprehend it!
Message-Id: <w47puar5y9j.fsf@origo.ifa.au.dk>
"Jay" <ReplyToTheGroup@DoNotEmailMe.Com> writes:
> Sorry for the pun in the subject. I had the following in a program.
Don't be. Puns are the highest form of humour.
> if(/\d+\.?\d+/) {
> print "OK!";
> }
> Now what I wanted was it to accept numbers which can be either whole
> numbers or decimal numbers(hence the period). This doesn't work,
> though. It accepts numbers alright, and anything else too. If I
> put it as /\d+\.\d+/ it works fine, but then the decimal is
> required(not what I wanted). Shouldn't adding the ? make it so it
> accepts one or more numbers zero or one decimal and one or more
> numbers? Obviously not, otherwise I wouldn't be here. I appreciate
> any help.
print "OK!" if ( /\d+\.*\d+/ );
print "OK!" if ( \/d*\.*\d*/ ); # if you want to accept .39 or 89. as valid.
For a more general solution to determining if a number is a decimal
try perldoc -q number, or use
print "OK!" if ( /^-?(?:\d+(?:\.\d*)?|\.\d+)$/ );
=====================================================================
To find out who and where I am look at:
http://www.nd.edu/~sholland/index.html
=====================================================================
------------------------------
Date: 23 Jul 2001 18:03:42 GMT
From: ebohlman@omsdev.com (Eric Bohlman)
Subject: Re: Escaped period! Someone apprehend it!
Message-Id: <9jhotu$rt8$1@bob.news.rcn.net>
Jay <ReplyToTheGroup@donotemailme.com> wrote:
> Sorry for the pun in the subject. I had the following in a program.
> if(/\d+\.?\d+/) {
> print "OK!";
> }
> Now what I wanted was it to accept numbers which can be either whole numbers
> or decimal numbers(hence the period). This doesn't work, though. It
> accepts numbers alright, and anything else too. If I put it as /\d+\.\d+/
That's because you haven't anchored the pattern at both ends, so it will
match if there's a number anywhere in the string. Also, it won't match
single-digit numbers as written; you need to make the part after the
decimal point optional as well. Try /^\d+(?:\.\d+)$/.
------------------------------
Date: Mon, 23 Jul 2001 17:51:59 +0200
From: "Georg Vassilopulos" <Georg.Vassilopulos@SoftwareAG.de>
Subject: fork / exec with Win NT Server
Message-Id: <9jhh70$qfh$1@gamma.ecomp.net>
Hi all!
I try to run "unzip" out of a cgi-script served by Apache under Win NT 4.0
Server.
The same code worked fine with another istallation on Win NT 4.0 (not Server
Edition)
Now I always get the"Internal Server error" I try to run my cgi script.
The perl interpreter does not say anything while running from dos box.
I checked file permissions and Apache is running as Administrator.
Help would be great!!!
Perl Version 5.005_03
my $file = "bla.zip";
my $command = "p:/tools/wni/unzip.exe $myFile";
unless (defined ($pid = fork)) {
print "No fork:$!\n";
}
unless ($pid) {
exec ($command) or print "exec $command not possible:$!";
exit;
}
waitpid ($pid, 0);
Have a good time...
Georg
wrkvg@SoftwareAG.com
------------------------------
Date: Mon, 23 Jul 2001 18:29:42 +0100
From: Rachel Coleman <rachel@lspace.org>
Subject: Re: Getting error on Oracle CLOB insert using PERL DBI
Message-Id: <s0noltoo217vgqol98qak7epp9agoeeeht@4ax.com>
On Wed, 18 Jul 2001 18:53:42 GMT, Greg <ethernaut43@yahoo.com> wrote:
>I've searched through the newsgroups but haven't found an answer:
>
>I am trying to insert a large amount of text (greater than 4K) into a
>CLOB field in my Oracle 8.1.5 table, using the PERL DBI. I get the
>following error:
>
>ORA-01461: can bind a LONG value only for insert into a LONG column (DBD
>
>ERROR: OCIStmtExecute)
>
>Does anyone know if this is a bug in either Oracle or the PERL DBI
>modules?
Are you trying to do a direct insert into the column or use a PL/SQL
function. I recently ran up against this (documented) problem with
the DBD::Oracle module.
See
http://theoryx5.uwinnipeg.ca/CPAN/data/DBD-Oracle/Oracle.html#Handling_LOBs
in particular the sentence
"Also passing LOBS to PL/SQL blocks doesn't work."
In my case I was trying to insert .jpg files into BLOB fields. The
approach that worked for my project was to make an exception to the
"use functions to do updates" rule we're using throughout the
database, and grant me insert and update rights directly on the table.
Best wishes,
Rachel
------------------------------
Date: Mon, 23 Jul 2001 16:58:52 GMT
From: Michael Budash <mbudash@sonic.net>
Subject: Re: Help replacing strings needed.
Message-Id: <mbudash-D01DE1.09585523072001@news.sonic.net>
In article <c4c08f5f.0107230647.19ab76c9@posting.google.com>,
Mark.S.Smith@marconi.com (Mark Smith) wrote:
> I have a script that reads in a file in the following format.
>
> files {
> "..\..\..\path\files\filename.ext",
> "..\..\somepath\anotherfile.txt",
> "..\..\..\mypath\new\generated\last_file.as"
> }
> config {
>
> }
>
> It asks the user to specify a path name. What I need to do is write
> out the file I've read in but where I have quotes I want to replace
> the path with the one entered by the user and to keep the filename at
> the end. It must maintain the format as above with no comma after the
> last quote and all the other surrounding information.
>
> I've tried different things but nothing that quite does what I want.
> Can anyone help?
>
> Thanks in advance.
>
> Mark
these should get you started:
$newpath = '..\the\new\path'; # for example
$file = '..\..\..\path\files\filename.ext'; # for example
$file =~ s/^.+(\\[^\\]+)$/$newpath$1/;
OR
$newpath = '..\the\new\path'; # for example
$file = '..\..\..\path\files\filename.ext'; # for example
@file = split (/\\/, $file);
$file = $newpath . '\\' . $file[$#file];
hth-
--
Michael Budash ~~~~~~~~~~ mbudash@sonic.net
------------------------------
Date: Mon, 23 Jul 2001 17:57:14 GMT
From: David Marshall <marshall@chezmarshall.com>
Subject: Re: Help replacing strings needed.
Message-Id: <MPG.15c62f7b77e6f33989689@news.earthlink.net>
In article <c4c08f5f.0107230647.19ab76c9@posting.google.com>,
Mark.S.Smith@marconi.com says...
> I have a script that reads in a file in the following format.
>
> files {
> "..\..\..\path\files\filename.ext",
> "..\..\somepath\anotherfile.txt",
> "..\..\..\mypath\new\generated\last_file.as"
> }
> config {
>
> }
>
> It asks the user to specify a path name. What I need to do is write
> out the file I've read in but where I have quotes I want to replace
> the path with the one entered by the user and to keep the filename at
> the end. It must maintain the format as above with no comma after the
> last quote and all the other surrounding information.
>
> I've tried different things but nothing that quite does what I want.
> Can anyone help?
>
> Thanks in advance.
>
> Mark.
>
Take a look at File::Basename for pathname-parsing fun.
Here's some various debugger crap that may help to guide what you're
doing. I used / as a directory separator rather than \.
If you're lucky, someone may point out that you can do all of this with
substr().
DB<2> p $txt
files {
"../../..path/files/filename.ext",
"../../somepath/anotherfile.txt",
"../../../mypath/new/generated/last_file.as"
}
DB<3> @files = $txt =~ /"(.*?)"/g
DB<4> x @files
0 '../../..path/files/filename.ext'
1 '../../somepath/anotherfile.txt'
2 '../../../mypath/new/generated/last_file.as'
DB<5> use File::Basename
DB<8> @newfiles = map {sprintf '/your/new/path/here/%s', basename $_}
@files
DB<9> x @newfiles
0 '/your/new/path/here/filename.ext'
1 '/your/new/path/here/anotherfile.txt'
2 '/your/new/path/here/last_file.as'
DB<10> p "files {\n", join(",\n" => map {qq("$_")} @newfiles), "\n}\n"
files {
"/your/new/path/here/filename.ext",
"/your/new/path/here/anotherfile.txt",
"/your/new/path/here/last_file.as"
}
------------------------------
Date: 23 Jul 2001 17:13:19 GMT
From: Jim Turner <turnerj@lapdog.lmtas.lmco.com>
Subject: Re: HELP WITH PERLDAP!!!!!!!!!
Message-Id: <9jhlvf$6p12@news1.lmtas.lmco.com>
In comp.lang.perl.modules Merijn Broeren <merijnb@iloquent.nl> wrote:
> On the back of a napkin I noticed written by David Busby <dbusby3@slb.com>:
>> That at least did something. Now I get a segmentation fault with core
>> dump everytime. Any other ideas? I apperciate your help so far.
>>
>> > In comp.lang.perl.misc David Busby <dbusby3@slb.com> wrote:
>> > > I am trying to run perldap on Solaris 2.8 with perl version 5.00404.
>> >
> You are talking about 5.00404 here..
>> >
>> > use lib "/usr/lib/perl5/site_perl/5.005/sun4-solaris";
>> >
> But that points to a 5.005 version. Bet you there is a 5.004 as well.
> Better ofcourse to use 5.00503 anyway.
> Cheers,
> --
> Merijn Broeren | She doesn't want you to understand her. She knows that's
> Software Geek | impossible. She just wants you to understand yourself,
> | everything else is negotiable.
You migh wish to try Graham Barr's Net::LDAP module -- It is pure-Perl
and does not require Mozilla LDAP. Look in CPAN under authors/id/G/GB/GBARR/.
The name is misleading (perl-ldap-0.24.tar.gz), but is actually "Net::LDAP"
when installed.
Good luck,
Jim Turner
------------------------------
Date: Mon, 23 Jul 2001 12:39:50 -0500
From: S P Arif Sahari Wibowo <arifsaha@yahoo.com>
Subject: Re: I found sprintf - is there a sscanf?
Message-Id: <Pine.GSO.4.10.10107231237290.3313-100000@bluestem.prairienet.org>
On Mon, 23 Jul 2001, Uri Guttman wrote:
>as someone showed you, there are multiple ways to parse a line without a
>sscanf equiv. in fact perl's ways are so much better than sscanf, that i
>am glad larry didn't include it. sscanf is a painful function. regexes
>or split are much better.
Plus that sscanf - if included - may not obey the locale rules as sprintf
is not (regardless what the documentation said). While the internal
conversion do obey the locale rules. :-)
--
S P Arif Sahari Wibowo
_____ _____ _____ _____
/____ /____/ /____/ /____ arifsaha@yahoo.com
_____/ / / / _____/ http://www.arifsaha.com/
------------------------------
Date: 23 Jul 2001 17:46:03 GMT
From: ebohlman@omsdev.com (Eric Bohlman)
Subject: Re: Large Filesystem Scrubbers
Message-Id: <9jhnsr$hj6$2@bob.news.rcn.net>
Rob Kirby <kirbyr@ucar.edu> wrote:
> We have a relatively large GPFS filesystem that we support (~2TB),
> and we have a home grown filesystem scrubber which will get rid of files
> based on thresholds, i.e. if %utilization reaches a certain high
> level then the scrubber will scrub the oldest files down to
> a certain low level. Also, it supports an "exempt" list for
> those files and users who are exempt from the scrubber. That's
> it in a nutshell.
> The problem I currently have though is that I have inherited the
> scrubber and it was written by different people no longer involved
> and consists of a half dozen home-brew utilities written very generically,
> to work on other platforms besides AIX. I would like to convert the
> whole thing from C code into Perl code, but I fear that performance
> will suffer seeings how I need to walk the complete tree and stat every
> single file, excluding open files, then sorting on the oldest files
> first.......... if you catch my drift ;-)
It sounds to me like it's going to be almost completely IO bound, so I
don't see going from C to Perl causing a major slowdown. Try implementing
something on a small scale and actually time it.
------------------------------
Date: 23 Jul 2001 15:47:43 GMT
From: ctcgag@hotmail.com
Subject: Re: Regular Expression Experts
Message-Id: <20010723114743.501$iZ@newsreader.com>
"Gerard Lapidario" <ghed9@netzero.net> wrote:
> Hello group,
>
> I need your help with regular expression. I need to extract strings
> which fit the format of (\d+)(/(\d+)+
>
> example:
> 1) asdf132/123-1432
> I should get 132/123
> 2) atm212/32
> I should get 212/32
> 3) a233/322/32
> I should get 233/322/32
> 4) 232/31/232/21/221/21
> I should get 232/31/232/21/221/21
What should you get for "Hello there"?
for "56/dog"?
for "dog/42"?
for "hi1/2there3/4"?
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service
------------------------------
Date: Mon, 23 Jul 2001 14:37:27 +0300
From: Deneb Pettersson <Deneb.Pettersson@lmf.ericsson.se>
Subject: Re: Remote updating of my website
Message-Id: <3B5C0C77.1E63FF3@lmf.ericsson.se>
lol, ffs you should at least tell him something useful....
That sounds nice, you need a script that is run on your ISP's server, which
just calls up their mail server , checks if you have mail, and then if it
sees the subject it would write it into your web page...
Some problems with this approach :
- Your webserver They either have both on different servers, or they just
don't like scripts running stuff like that on their computers...
- If i send a mail wiht the same subject it will get posted onto your
webpage....
What i'd suggest for your problem is to ask a friend to be your webmaster for
a while, buy him a case of beer and he'll be just fine. Then you just send
him your daily mail, and he then puts it up....THis gives you additional
freedom, as you can tell him to do this and this and make this bold if you
want to... also you can tell him to scan and put the picture you send him via
snail mail onto the page aswell, or a postcard or whatever....
hth
Deneb
ffg wrote:
> How about you stay on dry land, I go on the boat trip, and phone you with
> updates to the site, for a fee, of course.
>
> "Simon Marshall - SMA" <SMarshall@bluedisc.com> wrote in message
> news:3F8CBF7D9D43D4119E8100508B6CB0FDF2E76F@redstripe...
> > Hi all
> >
> > I have a website http://www.narrowboat-havana.co.uk
> > which is all about the
> > boat I live on in London.
> >
> > I'm going to be going for a year long cruise around
> > the waterways of England
> > and I want to be able to update the site daily with a
> > cruise log for the
> > day.
> >
> > Someone tells me that some perl script on my site
> > would enable me to update
> > it via email, i.e. send an email to
> > simon.marshall@clara.net with a subject
> > line CRUISE LOG and it'll create a new entry on a page
> > on my site. I know nothing about perl though.
> >
> > Before you suggest linking a mobile to a laptop and
> > doing it via html & ftp,
> > what I want to do is send the emails from my mobile
> > phone and keep it
> > simple.
> >
> > Any ideas? My service provider is clara.net if that's
> > of any help.
> >
> > Thanks
> >
> > Simon Marshall
> >
> >
> >
> > --
> > Posted from mail.london-2.starlabs.net [212.125.75.4]
> > via Mailgate.ORG Server - http://www.Mailgate.ORG
------------------------------
Date: Mon, 23 Jul 2001 08:41:51 -0700
From: Ron Hill <hillr@ugs.com>
Subject: Re: Sendmail with Win32
Message-Id: <3B5C45BF.7DCE99EA@ugs.com>
> What I would like to know is if anyone knows of a sendmail utility
> that works on Windows NT with Exchange server. The reason I'd like to
> use a sendmail compatible program is for portability.
>
> I have a large number of Perl scripts on a Unix platform that notify
> me by e-mail when there is a problem. I'd like to use some of them in
> an NT/IIS environment without having to do a lot of reconfiguring my
> scripts.
>
>
http://groups.google.com/groups?as_q=sendmail%20and%20windows&as_ugroup=comp.lang.perl.misc
------------------------------
Date: Mon, 23 Jul 2001 11:45:17 -0400
From: Andras Malatinszky <andras@mortgagestats.com>
Subject: Re: Sendmail with Win32
Message-Id: <3B5C468D.157B93A6@mortgagestats.com>
Jeff Hill wrote:
> First, before anyone flames me, I know this is off subject, but I felt
> that this community was much more likely to have someone who has
> encountered this situation than the Windows NT community (since most
> hardcore MS users wouldn't know a Unix box if it hit them upside the
> head).
>
> What I would like to know is if anyone knows of a sendmail utility
> that works on Windows NT with Exchange server. The reason I'd like to
> use a sendmail compatible program is for portability.
>
> I have a large number of Perl scripts on a Unix platform that notify
> me by e-mail when there is a problem. I'd like to use some of them in
> an NT/IIS environment without having to do a lot of reconfiguring my
> scripts.
>
> Thank you all
>
> Jeff Hill
A very rich resource on sendmail can be found at http://www.sendmail.org.
------------------------------
Date: Mon, 23 Jul 2001 16:17:59 +0100
From: "Tom Melly" <tom.melly@ccl.com>
Subject: Re: Sorry for the multiple posts
Message-Id: <3b5c4027$0$3761$ed9e5944@reading.news.pipex.net>
"Bob Rock" <no_spam.yet_another_apprentice@hotmail.com> wrote in message
news:9jfda7$nssp7$1@ID-98646.news.dfncis.de...
> Please excuse the multiple posts.
>
*HAD* problems? ;)
------------------------------
Date: Mon, 23 Jul 2001 11:48:06 -0600
From: Todd Anderson <todd@mrnoitall.com>
Subject: use CGI qw(:standard)
Message-Id: <3B5C614E.13278F24@mrnoitall.com>
Dear Peoples,
I am using "use CGI qw(:standard);" In the past when using cgi-lib.pl I
could do this...
$form_data{'pagename'} = $form_data('glockenspider');
When I try it with "CGI" I use this...
param('pagename') = param('glockenspider');
But this doesn't work... Any ideas are appreciated. Thanks in advance
for your help
------------------------------
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 1360
***************************************