[24028] in Perl-Users-Digest
Perl-Users Digest, Issue: 6225 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Mar 6 09:05:59 2004
Date: Sat, 6 Mar 2004 06:05:07 -0800 (PST)
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, 6 Mar 2004 Volume: 10 Number: 6225
Today's topics:
Automating Processes? <bumble@what.the.heck>
Re: Automating Processes? <spamtrap@deepsea.force9.co.uk>
Re: Automating Processes? (Anno Siegel)
HOW TO CHECK URL?? <luke@program.com.tw>
Re: HOW TO CHECK URL?? <nospam@bigpond.com>
Re: HOW TO CHECK URL?? <usenet@morrow.me.uk>
Re: HOW TO CHECK URL?? <kasp@epatra.com>
Re: how to see how many open file descriptors my progra <pkent77tea@yahoo.com.tea>
Re: Is it possible to impose a timeout on <>? <pkent77tea@yahoo.com.tea>
learning perl (morteza)
Re: learning perl <noreply@gunnar.cc>
Re: learning perl <perl@my-header.org>
Re: open (FAILEHANDLER, ">>$filename") what is the ron <me@privacy.net>
Re: open (FAILEHANDLER, ">>$filename") what is the ron <Joe.Smith@inwap.com>
Re: open (FAILEHANDLER, ">>$filename") what is the ron (Anno Siegel)
Re: Perl program and database locked but alive <gnari@simnet.is>
Re: References Subroutines and Arrays <spamtrap@deepsea.force9.co.uk>
regexp <bckumari@yahoo.com>
Re: regexp <jurgenex@hotmail.com>
Re: regexp (Anno Siegel)
Re: regexp <gnari@simnet.is>
Re: scheduling a perl script <usenet@morrow.me.uk>
Re: scheduling a perl script (Anno Siegel)
Re: scheduling a perl script <gnari@simnet.is>
serializing access to a resource in my mod_perl PerlHan (John Kelly)
subtitute a string. (Charlie)
Re: subtitute a string. <theforce@forcet.net>
Re: subtitute a string. (Anno Siegel)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 6 Mar 2004 13:19:37 -0000
From: "Bumble" <bumble@what.the.heck>
Subject: Automating Processes?
Message-Id: <c2cj39$l6o$1@news8.svr.pol.co.uk>
Basically I have my script that retrieves data from another site, the data
is update say every hour. Is there anyway I could automate my script to look
for updated data every hour? Is there any kind of 'wait' command or time
checking command?
TIA
Simon
--
Bumble
------------------------------
Date: Sat, 06 Mar 2004 13:26:56 GMT
From: Iain <spamtrap@deepsea.force9.co.uk>
Subject: Re: Automating Processes?
Message-Id: <Xns94A4884BE10C9coraldeepsea@212.159.13.2>
"Bumble" <bumble@what.the.heck> wrote in
news:c2cj39$l6o$1@news8.svr.pol.co.uk:
> Basically I have my script that retrieves data from another site, the
> data is update say every hour. Is there anyway I could automate my
> script to look for updated data every hour? Is there any kind of
> 'wait' command or time checking command?
perldoc -f sleep
perldoc -f alarm
or for a non-Perl solution, but quite possibly more sensible:
man crontab (on unix-like systems)
at /? (on Windows NT-like systems)
--
Iain | PGP mail preferred: pubkey @ www.deepsea.f9.co.uk/misc/iain.asc
($=,$,)=split m$"13/$,qq;13"13/tl\.rnh r HITtahkPctacriAneeeusaoJ;;
for(@==sort@$=split m,,,$,){$..=$$[$=];$$=$=[$=];$@=1;$@++while$=[--$=
]eq$$&&$=>=$?;$==$?;for(@$){$@--if$$ eq$_;;last if!$@;$=++}}print$..$/
------------------------------
Date: 6 Mar 2004 13:24:19 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Automating Processes?
Message-Id: <c2cje3$74d$2@mamenchi.zrz.TU-Berlin.DE>
Bumble <bumble@what.the.heck> wrote in comp.lang.perl.misc:
> Basically I have my script that retrieves data from another site, the data
> is update say every hour. Is there anyway I could automate my script to look
> for updated data every hour? Is there any kind of 'wait' command or time
> checking command?
perldoc -f sleep
Anno
------------------------------
Date: Sat, 6 Mar 2004 21:35:01 +0800
From: "news.hinet.net" <luke@program.com.tw>
Subject: HOW TO CHECK URL??
Message-Id: <c2cjuq$eeh@netnews.hinet.net>
HTTP://123.22.1.33 TRUE
HTTP://123.22.1.333 FAIL
http://123.22.1 fail
ftp://abc.efg.net true
ftp://abc.efg.nnn fail
http://abc.efg*.net fail
------------------------------
Date: Sat, 06 Mar 2004 23:42:43 +1000
From: Gregory Toomey <nospam@bigpond.com>
Subject: Re: HOW TO CHECK URL??
Message-Id: <4459206.hJaD3rZHOf@GMT-hosting-and-pickle-farming>
news.hinet.net wrote:
> HTTP://123.22.1.33 TRUE
> HTTP://123.22.1.333 FAIL
> http://123.22.1 fail
>
> ftp://abc.efg.net true
> ftp://abc.efg.nnn fail
> http://abc.efg*.net fail
What do you want to do - ping, check http headers/return codes, or work with
general URIs.
Check out LWP::Simple (get) & LWP::UserAgent in www.cpan.org
gtoomey
------------------------------
Date: Sat, 6 Mar 2004 13:45:12 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: HOW TO CHECK URL??
Message-Id: <c2ckl8$pgs$1@wisteria.csv.warwick.ac.uk>
"news.hinet.net" <luke@program.com.tw> wrote:
> HTTP://123.22.1.33 TRUE
> HTTP://123.22.1.333 FAIL
> http://123.22.1 fail
>
> ftp://abc.efg.net true
> ftp://abc.efg.nnn fail
> http://abc.efg*.net fail
Regexp::Common
Ben
--
I've seen things you people wouldn't believe: attack ships on fire off
the shoulder of Orion; I watched C-beams glitter in the dark near the
Tannhauser Gate. All these moments will be lost, in time, like tears in rain.
Time to die. ben@morrow.me.uk
------------------------------
Date: Sat, 6 Mar 2004 13:52:20 -0000
From: "Kasp" <kasp@epatra.com>
Subject: Re: HOW TO CHECK URL??
Message-Id: <c2ckvb$ufb$1@newsreader.mailgate.org>
"news.hinet.net" <luke@program.com.tw> wrote in message
> HTTP://123.22.1.33 TRUE
> HTTP://123.22.1.333 FAIL
> http://123.22.1 fail
Ping to the given URL.
You could uset Net::Ping
------------------------------
Date: Sat, 06 Mar 2004 11:46:28 +0000
From: pkent <pkent77tea@yahoo.com.tea>
Subject: Re: how to see how many open file descriptors my program has?
Message-Id: <pkent77tea-EC3AF1.11462806032004@pth-usenet-02.plus.net>
In article <c70a85ff.0403040154.6ecf243@posting.google.com>,
uffesterner@spamhole.com (Rex Gustavus Adolphus) wrote:
> I have a problem with a deamon-program I've written that after a
> couple of days/weeks runs out of file descriptors.
>
> I wonder if there is a command
> to see how many open file descriptors my program has?
>
> And is there a command
> to see how many open file descriptors the system has?
The ulimit command might be of use in raising the limit, although that
doesn't really solve the problem.
> I am not opening them explicitly,
> I think they are being opened by
> glob() and/or File::Copy::move
Interesting - I'd have thought that these wouldn't leak filehandles...
One thing that I've seen is where someone used an opendir() to open a
directory and then they did close() on that handle, not closedir(). Soon
the program ran out of directory handles.
Grep through your code for any occurence of 'open' or creating a new
Filehandle object of some kind. In long-running processes like your
daemon you should probably keep the scope of filehandle objects as tight
as possible, maybe localise normal file/directory handles, and ensure
that you close handles as soon as you possibly can.
The /proc filesystem mentioned by zentara is common but not available on
all systems - just something to watch out for. The handy thing about the
links in fd is that they point, on my system anyway, to the actual
filenames, so if I do 'ls -lab' in that directory I can see what files
are open.
P
--
pkent 77 at yahoo dot, er... what's the last bit, oh yes, com
Remove the tea to reply
------------------------------
Date: Sat, 06 Mar 2004 11:58:47 +0000
From: pkent <pkent77tea@yahoo.com.tea>
Subject: Re: Is it possible to impose a timeout on <>?
Message-Id: <pkent77tea-0167A5.11584706032004@pth-usenet-02.plus.net>
In article <e8f67309.0403050035.4ad523c3@posting.google.com>,
megapode@hotmail.com (Bob Dubery) wrote:
> This is done via HTTP
...
> The program hangs at the <> operator.
>
> OK... a wierd situation and not a common one, but I want to improve
> the code. Specificially when I invoke <> I'd like to be able to impose
> a time out so that if I get nothing back after n seconds I can raise
> an error condition and start interrogating the next site.
Here is some example code:
my $line;
eval {
alarm($alarmtime);
$line = <SOCKET>;
};
alarm 0; # cancel the alarm
if ($@) {
# whatever error handling...
}
There may be better ways that use lower-level reading functions though.
P
--
pkent 77 at yahoo dot, er... what's the last bit, oh yes, com
Remove the tea to reply
------------------------------
Date: 6 Mar 2004 04:19:54 -0800
From: m_mosazadeh_urmia@yahoo.com (morteza)
Subject: learning perl
Message-Id: <9f57719a.0403060419.7922f641@posting.google.com>
I want to learn perl.please help me.
------------------------------
Date: Sat, 06 Mar 2004 13:54:35 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: learning perl
Message-Id: <c2cht1$1qsrp6$1@ID-184292.news.uni-berlin.de>
morteza wrote:
> I want to learn perl.please help me.
http://learn.perl.org/
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Sat, 06 Mar 2004 13:57:35 +0100
From: Matija Papec <perl@my-header.org>
Subject: Re: learning perl
Message-Id: <2jij40lae5602f273dohg793kujrj9nott@4ax.com>
X-Ftn-To: morteza
m_mosazadeh_urmia@yahoo.com (morteza) wrote:
>I want to learn perl.please help me.
check out http://books.perl.org
--
Matija
------------------------------
Date: Sat, 6 Mar 2004 20:44:39 +1300
From: "Tintin" <me@privacy.net>
Subject: Re: open (FAILEHANDLER, ">>$filename") what is the rong with that
Message-Id: <c2bvjs$1p1lde$1@ID-172104.news.uni-berlin.de>
"Sameh Abdelatef" <samehabdelatef@yahoo.com> wrote in message
news:a2f806f.0403051608.4f6270bf@posting.google.com...
[removed dead group comp.lang.perl]
> I used to use[ open (FAILEHANDLER, ">>$filename");] to open and add
> new lines to $filename, but it didn't work any more.
Define "didn't work"
Got an error and died?
Deleted the file?
Gave you incorrect results?
Gave you dandruff?
>The perl version
> is 5.8.1. When I try [ open (FAILEHANDLER, ">$filename");] it's work
> but the content of $filename is deletd.
As you would expect.
The moral of the story is to *always* use error checking.
------------------------------
Date: Sat, 06 Mar 2004 07:51:11 GMT
From: Joe Smith <Joe.Smith@inwap.com>
Subject: Re: open (FAILEHANDLER, ">>$filename") what is the rong with that
Message-Id: <Opf2c.125529$4o.165907@attbi_s52>
Sameh Abdelatef wrote:
> I used to use[ open (FAILEHANDLER, ">>$filename");] to open and add
> new lines to $filename, but it didn't work any more. The perl version
> is 5.8.1. When I try [ open (FAILEHANDLER, ">$filename");] it's work
> but the content of $filename is deletd.
You have correctly described the difference between ">>" and ">".
So, what is the problem?
-Joe
------------------------------
Date: 6 Mar 2004 13:54:33 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: open (FAILEHANDLER, ">>$filename") what is the rong with that
Message-Id: <c2cl6p$83m$2@mamenchi.zrz.TU-Berlin.DE>
[bogus newsgroup comp.lang.perl trimmed]
Joe Smith <Joe.Smith@inwap.com> wrote in comp.lang.perl.misc:
> Sameh Abdelatef wrote:
>
> > I used to use[ open (FAILEHANDLER, ">>$filename");] to open and add
> > new lines to $filename, but it didn't work any more. The perl version
> > is 5.8.1. When I try [ open (FAILEHANDLER, ">$filename");] it's work
> > but the content of $filename is deletd.
>
> You have correctly described the difference between ">>" and ">".
> So, what is the problem?
It doesn't work is the problem :)
The symptoms are consistent with a full file system.
Anno
------------------------------
Date: Sat, 6 Mar 2004 13:40:45 -0000
From: "gnari" <gnari@simnet.is>
Subject: Re: Perl program and database locked but alive
Message-Id: <c2ckas$v4f$1@news.simnet.is>
"TF" <theforce@forcet.net> wrote in message news:404947d8$1@nntp0.pdx.net...
> Is there any way to intervene with a program that is still running, but
> locked during database read/write subs, to see where the lockup is coming
> from?
print debug info into a log file
when deadlock occur, read the logfile
you give no info about your application, or what kind of locking
is used, but often the risk of deadlocks can be reduced by being
careful about order of updated within transactions.
for example if in one place you have
transaction update a, update b
and in another place a transaction update b, update a
you have greatly increased risk of deadlocks
gnari
------------------------------
Date: Sat, 06 Mar 2004 13:49:36 GMT
From: Iain <spamtrap@deepsea.force9.co.uk>
Subject: Re: References Subroutines and Arrays
Message-Id: <Xns94A48CF4FB307coraldeepsea@212.159.13.1>
ketema@ketema.net (Ketema) wrote in
news:84bca20f.0403051046.520f6b9e@posting.google.com:
> I am a little lost on how PERL handles references and array's,
> especially when you pass and array to a subroutine. Here is some code
> I have working to try and get a better understanding. I read perldoc
> perlref, and I just don't see why this isn't working...Please help!
*snip* some very confused code.
The following might help you get things a bit clearer in your head.
Perl's parameter-passing technique is simple -- so simple in fact that
it often confuses those used to other high-level languages!
If you don't understand how or why the following code does what it does,
have a read of 'perldoc perlsub' and 'perldoc perlref'. Play with the
code, adding in your own parameters, look at the code again, re-read the
documentation and if you still can't work it out, feel free to post here
again!
#!/usr/bin/perl
use strict;
use warnings;
# Simplest case
print "Passing parameters directly: ";
show_params( 'one', 2, 3, 'four items' );
my @array;
@array = ( 'foo', 'bar', 'wibble' );
print "Array of 3 scalars: ";
show_params( @array );
@array = ( [ 'alpha', 'beta', 'gamma' ], [ 'a', 'b', 'c' ],
[ 'aleph', 'beth', 'gimel' ] );
print "Array of 3 arrayrefs (LoL): ";
show_params( @array );
@array = ( { foo => 'bar' }, { fee => 'far' } );
print "Array of 2 hashrefs (LoH): ";
show_params( @array );
sub show_params {
# Perl _ALWAYS_ passes all parameters into the special array @_
# A C programmer might do the following (but please don't):
# my ($argc, $argv) = (scalar(@_), @_);
my @parameters = @_;
print "I was passed " . scalar( $n_params ) . " parameters\n";
foreach my $i ( 0..@parameters ) {
my $param = $parameters[$i];
# This loop sets $param to each parameter in turn. We can find out
# what sort of thing $param is using the ref() function:
ref( $param ) =~ /ARRAY/ and print " Parameter $i is an ARRAYREF\n"
or
ref( $param ) =~ /HASH/ and print " Parameter $i is a HASHREF\n"
or
ref( $param ) and print " Parameter $i is an OBJECT\n"
or
print " Parameter $i is a SCALAR\n";
}
}
--
Iain | PGP mail preferred: pubkey @ www.deepsea.f9.co.uk/misc/iain.asc
($=,$,)=split m$"13/$,qq;13"13/tl\.rnh r HITtahkPctacriAneeeusaoJ;;
for(@==sort@$=split m,,,$,){$..=$$[$=];$$=$=[$=];$@=1;$@++while$=[--$=
]eq$$&&$=>=$?;$==$?;for(@$){$@--if$$ eq$_;;last if!$@;$=++}}print$..$/
------------------------------
Date: Sat, 6 Mar 2004 00:08:58 -0600
From: "kums" <bckumari@yahoo.com>
Subject: regexp
Message-Id: <e316e4abc27c486bf7d0d96156b96360@localhost.talkaboutprogramming.com>
hi,
$text="hello";
if($text=~/el/)
{
print $&;
}
how to delete the contents of '$&'?
------------------------------
Date: Sat, 06 Mar 2004 06:11:51 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: regexp
Message-Id: <HYd2c.54028$6K.17782@nwrddc02.gnilink.net>
kums wrote:
> hi,
> $text="hello";
> if($text=~/el/)
> {
> print $&;
> }
>
> how to delete the contents of '$&'?
You can't. From "perldoc perlvar":
$& [...] This variable is read-only [...]
------------------------------
Date: 6 Mar 2004 13:28:49 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: regexp
Message-Id: <c2cjmh$74d$3@mamenchi.zrz.TU-Berlin.DE>
Jürgen Exner <jurgenex@hotmail.com> wrote in comp.lang.perl.misc:
> kums wrote:
> > hi,
> > $text="hello";
> > if($text=~/el/)
> > {
> > print $&;
> > }
> >
> > how to delete the contents of '$&'?
>
> You can't. From "perldoc perlvar":
> $& [...] This variable is read-only [...]
"...delete the contents of '$&'" is truly ambiguous. I think the answer
OP was aiming for is "s/el//".
Anno
------------------------------
Date: Sat, 6 Mar 2004 13:55:07 -0000
From: "gnari" <gnari@simnet.is>
Subject: Re: regexp
Message-Id: <c2cl6h$v6k$1@news.simnet.is>
"kums" <bckumari@yahoo.com> wrote in message
news:e316e4abc27c486bf7d0d96156b96360@localhost.talkaboutprogramming.com...
> $text="hello";
> if($text=~/el/)
> {
> print $&;
> }
>
> how to delete the contents of '$&'?
what is your real question ? (why do you *think* that
you need to delete the content of $& ?)
gnari
------------------------------
Date: Sat, 6 Mar 2004 13:04:41 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: scheduling a perl script
Message-Id: <c2ci99$om3$1@wisteria.csv.warwick.ac.uk>
s99999999s2003@yahoo.com (mike) wrote:
> How can i implement in perl such that on the 11th, my script will not
> mistake that test.txt is not there while in fact, it has already been
> transfered to another server and removed after transfered?
> I thought of not removing test.txt after transfered but if the file
> arrived on the 8th, then on the 9th i would do another identical
> transfer.
>
> I also thought of using a "status" file. Something like
>
> open ( STATUS , "> status.out");
> print STATUS "0";
>
> then if test.txt arrrives, do the transfer, remove the file and update
> STATUS.
> Is this the correct way to do ??
I would simply use the presence or absence of your status file. So start
with it not there; when you ftp the file, delete it and create your
status file; on day 11, check for the status file and remove it.
Ben
--
I've seen things you people wouldn't believe: attack ships on fire off
the shoulder of Orion; I watched C-beams glitter in the dark near the
Tannhauser Gate. All these moments will be lost, in time, like tears in rain.
Time to die. ben@morrow.me.uk
------------------------------
Date: 6 Mar 2004 13:45:38 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: scheduling a perl script
Message-Id: <c2ckm2$83m$1@mamenchi.zrz.TU-Berlin.DE>
mike <s99999999s2003@yahoo.com> wrote in comp.lang.perl.misc:
> hi
>
> i wrote a script that is supposed to check a directory and see if
> there is a file named "test.txt" there and if there is , use ftp to
> transfer the file to another server and then remove the file from the
> directory.
> I had scheduled a job in windows to poll for this directory looking
> for "test.txt" every month on day 8, 9 and 10 and 11, because test.txt
> will arrive anytime during 8,9 and 10. On the 11th, my script will
> poll the directory and if there is still no test.txt, will alert the
> administrator.
>
> How can i implement in perl such that on the 11th, my script will not
> mistake that test.txt is not there while in fact, it has already been
> transfered to another server and removed after transfered?
> I thought of not removing test.txt after transfered but if the file
> arrived on the 8th, then on the 9th i would do another identical
> transfer.
One solution might be to let it do just that. What's a spurious file
transfer or three among friends? On the 11th, delete it to stop the
transfers. If there's nothing to delete, blow the horn.
> I also thought of using a "status" file. Something like
>
> open ( STATUS , "> status.out");
> print STATUS "0";
>
> then if test.txt arrrives, do the transfer, remove the file and update
> STATUS.
> Is this the correct way to do ??
Your question has nothing to do with Perl. The problem would be the same
if you were to implement it in any other language.
A status file is one solution, but you may not need one, even if you
want to avoid extra transfers.
Don't remove the file, move it, to a subdirectory "done" for instance.
Then it won't invite another transfer, but it's still around to show
it's been dealt with. Again, clear the "done" directory every 11th.
Anno
------------------------------
Date: Sat, 6 Mar 2004 13:52:48 -0000
From: "gnari" <gnari@simnet.is>
Subject: Re: scheduling a perl script
Message-Id: <c2cl24$v65$1@news.simnet.is>
"mike" <s99999999s2003@yahoo.com> wrote in message
news:dfd17ef4.0403052053.632e2e8e@posting.google.com...
[snip question]
a) use a better subject line. this question is not really about
scheduling a perl script
b) this is not really a perl question. figure out how you want to do
it, and if you have problems with the perl implementation, ask
about that.
but to answer it, yes a status file would be one way of doing it,
either by testing a value in it, or even just by testing for its
presence.
if you use a value in the flag, you must either reset the value after
the last check so that it will not interfere with next month's file
c) assuming it IS a perl question:
> open ( STATUS , "> status.out");
check if the open succeeded
if you do not use a full path to the file, make sure
the current directory is correct
gnari
------------------------------
Date: 6 Mar 2004 00:27:39 -0800
From: john_kelly@uk.ibm.com (John Kelly)
Subject: serializing access to a resource in my mod_perl PerlHandler
Message-Id: <c256fbe4.0403060027.323aa5f5@posting.google.com>
a mod_perl script i wrote quite some time ago has recently had
increased "traffic". this has shown up a problem (i think) with
serialization
of resource in the "back-end" system that my mod_perl routine provides
a wrapper for.
In the short-term, while i'm investigating the problem i'd like
quickly to modify something so all requests through the PerlHandler
which processes the content are serialized.
So, is there a configuration directive which can do this without
modification to the script itself ? If not, how can i implement some
form of serialization within the handler ?
thanks in advance
John
------------------------------
Date: 5 Mar 2004 22:34:51 -0800
From: cji_work@yahoo.com (Charlie)
Subject: subtitute a string.
Message-Id: <1dc70d61.0403052234.6952229b@posting.google.com>
A string of a http address in the format of xxx.com, xxx.gov or
xxx.org. I want to check and substitute it in just one SINGLE line,
such as:
$value =~ s/xxx//;
#"xxx" could be "com", "gov", or "org".
What will the "xxx" be ?
-CJ
------------------------------
Date: Fri, 5 Mar 2004 23:24:08 -0800
From: "TF" <theforce@forcet.net>
Subject: Re: subtitute a string.
Message-Id: <4049847b$1@nntp0.pdx.net>
"Charlie" <cji_work@yahoo.com> wrote in message
news:1dc70d61.0403052234.6952229b@posting.google.com...
> A string of a http address in the format of xxx.com, xxx.gov or
> xxx.org. I want to check and substitute it in just one SINGLE line,
> such as:
>
> $value =~ s/xxx//;
> #"xxx" could be "com", "gov", or "org".
>
>
> What will the "xxx" be ?
>
> -CJ
huh
------------------------------
Date: 6 Mar 2004 13:22:53 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: subtitute a string.
Message-Id: <c2cjbd$74d$1@mamenchi.zrz.TU-Berlin.DE>
Charlie <cji_work@yahoo.com> wrote in comp.lang.perl.misc:
> A string of a http address in the format of xxx.com, xxx.gov or
> xxx.org. I want to check and substitute it in just one SINGLE line,
> such as:
>
> $value =~ s/xxx//;
> #"xxx" could be "com", "gov", or "org".
>
>
> What will the "xxx" be ?
How are you doing it in multiple lines, and what's wrong with it?
Anno
------------------------------
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.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
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 6225
***************************************