[30112] in Perl-Users-Digest
Perl-Users Digest, Issue: 1355 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Mar 12 00:09:47 2008
Date: Tue, 11 Mar 2008 21:09: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 Tue, 11 Mar 2008 Volume: 11 Number: 1355
Today's topics:
Re: Fastest way to send file to browser <howachen@gmail.com>
Re: Fastest way to send file to browser <howachen@gmail.com>
Re: Fastest way to send file to browser <howachen@gmail.com>
Re: Getting permissions using Win32::TieRegistry <XXjbhuntxx@white-star.com>
Re: How to send email with perl, or at least control Ou <jack_posemsky@yahoo.com>
Re: How to send email with perl, or at least control Ou <newsgroup898sfie@8439.e4ward.com>
Re: How to send email with perl, or at least control Ou <newsgroup898sfie@8439.e4ward.com>
Re: How to submit an HTTP Request with XML <karinwalike@comcast.net>
Re: How to submit an HTTP Request with XML <ben@morrow.me.uk>
Matching multiple subexpressions in a regular expressio <sjackman@gmail.com>
Re: Matching multiple subexpressions in a regular expre <someone@example.com>
Re: regexp for s/// <bik.mido@tiscalinet.it>
Re: regular expression with split goes wrong ? <abigail@abigail.be>
Re: Setting up mod_perl <benkasminbullock@gmail.com>
Re: Starting a Perl script with no command prompt windo <benkasminbullock@gmail.com>
Re: text substitution question <pauls@nospam.off>
Re: text substitution question <rvtol+news@isolution.nl>
Re: timeout problem with Net::Telnet <gniagnia@gmail.com>
Re: timeout problem with Net::Telnet <ben@morrow.me.uk>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 11 Mar 2008 20:24:26 -0700 (PDT)
From: howa <howachen@gmail.com>
Subject: Re: Fastest way to send file to browser
Message-Id: <41135f5f-a522-435c-87b1-b8af038e1511@i7g2000prf.googlegroups.com>
On 3$B7n(B12$BF|(B, $B>e8a(B12$B;~(B49$BJ,(B, xhos...@gmail.com wrote:
> howa <howac...@gmail.com> wrote:
> > In order to hidden the real path, I send the png file via CGI, e.g.
>
> > ##############
>
> > print "Content-type:image/png\n\n";
> > my $file = "test.png";
>
> > open INPUT_FILE, "$file" or die "Couldn't open file: $!";
> > while( sysread(INPUT_FILE, $data, 10240) ) {
> > print $data;
> > }
> > close FILE;
>
> > ##############
>
> > Any faster/better method?
>
> Take a step back and do some introspection on why you want to hide the
> real path in the first place.
>
> Xho
An example would be captcha images, good reason?
Thanks.
Howard
------------------------------
Date: Tue, 11 Mar 2008 20:24:40 -0700 (PDT)
From: howa <howachen@gmail.com>
Subject: Re: Fastest way to send file to browser
Message-Id: <0261651c-0778-483a-a2ab-6179e77ac52a@d21g2000prf.googlegroups.com>
On 3=D4=C211=C8=D5, =CF=C2=CE=E74=95r23=B7=D6, Frank Seitz <devnull4...@web.=
de> wrote:
> howa wrote:
> > In order to hidden the real path, I send the png file via CGI, e.g.
>
> > [Perl program]
>
> > Any faster/better method?
>
> An alias (HTTP server directive).
>
> Frank
> --
> Dipl.-Inform. Frank Seitz;http://www.fseitz.de/
> Anwendungen f=A8=B9r Ihr Internet und Intranet
> Tel: 04103/180301; Fax: -02; Industriestr. 31, 22880 Wedel
------------------------------
Date: Tue, 11 Mar 2008 20:27:00 -0700 (PDT)
From: howa <howachen@gmail.com>
Subject: Re: Fastest way to send file to browser
Message-Id: <a1ee3b93-895b-4192-b398-d2eec31bf2a0@s19g2000prg.googlegroups.com>
On 3$B7n(B11$BF|(B, $B2<8a(B4$B;~(B23$BJ,(B, Frank Seitz <devnull4...@web.de> wrote:
> howa wrote:
> > In order to hidden the real path, I send the png file via CGI, e.g.
>
> > [Perl program]
>
> > Any faster/better method?
>
> An alias (HTTP server directive).
>
Hi,
A path is mapped to many files, so the real file is only know when
client request for the page.
I have heard something like x-sendfile but we don't have this option
to use, so I must send thru perl.
Thanks.
Howard
------------------------------
Date: Wed, 12 Mar 2008 01:55:10 GMT
From: Cosmic Cruizer <XXjbhuntxx@white-star.com>
Subject: Re: Getting permissions using Win32::TieRegistry
Message-Id: <Xns9A5EC071ADA1Dccruizermydejacom@207.115.33.102>
Thomas Kratz <ThomasKratz@REMOVEwebCAPS.de> wrote in
news:47d5278f$0$2619$bb690d87@news.main-rheiner.de:
> Cosmic Cruizer wrote:
>> I can get most of the registry info I need by using
>> Win32::TieRegistry, but I cannot figure out how to get the
>> permissions for the keys. Is it possbile to get the key permissions
>> using TieRegistry? If not, is there a different way to use Perl to
>> get the registry key permissions?
>
> Win32::Perms is your friend.
>
> Try:
>
> ppm install http://www.roth.net/perl/packages/win32-perms.ppd
>
> Thomas
>
Thank you for the suggestion, but I'm not seeing how this will read the
permissions on a registry entry. It looks like it's geared towards file
permissions.
But thanks for letting me know about another useful tools.
------------------------------
Date: Tue, 11 Mar 2008 12:59:57 -0700 (PDT)
From: Jack <jack_posemsky@yahoo.com>
Subject: Re: How to send email with perl, or at least control Outlook Express
Message-Id: <9c48f672-8c67-4a58-9716-998da9b65085@e6g2000prf.googlegroups.com>
On Mar 11, 11:08=A0am, Michael Goerz <newsgroup898s...@8439.e4ward.com>
wrote:
> Jack wrote, on 03/11/2008 11:39 AM:
>
> > Hi for some reason I can send email and the target receives it with my
> > James mailserver via Outlook Express, but not via BLAT. =A0I am using
> > user/pass authentication.. can anyone point me to a script that works
> > and is simple for
> > 1- send an email directly (problem with below is email never shows up
> > at destination)
>
> Does this help you?http://www.physik.fu-berlin.de/~goerz/programs/mailpl/m=
ailpl.html
>
> Michael Goerz
Hi excellent for those looking for all the bells and whistles
(encryption, etc etc) - good work .however way too much code,
complexity, dependencies requiring install, etc for me, and when I got
it to run, ctrl-D didnt work.. is there anyway you can post a very
stripped down version that just does the very basic with basic user
authentication so I can run this ?
perl testemail4.pl --to=3Dguy@gmail.com --from=3Dsteve@sss.com --s
ubject=3Dtest --host=3Dsmtp.sss.com --port=3D25 --user=3Dsteve --pass=3D8989=
dud3
Thank you,
Jack
------------------------------
Date: Tue, 11 Mar 2008 18:23:11 -0400
From: Michael Goerz <newsgroup898sfie@8439.e4ward.com>
Subject: Re: How to send email with perl, or at least control Outlook Express
Message-Id: <63of2fF28423vU1@mid.uni-berlin.de>
Jack wrote, on 03/11/2008 03:59 PM:
> On Mar 11, 11:08 am, Michael Goerz <newsgroup898s...@8439.e4ward.com>
> wrote:
>> Jack wrote, on 03/11/2008 11:39 AM:
>>
>>> Hi for some reason I can send email and the target receives it with my
>>> James mailserver via Outlook Express, but not via BLAT. I am using
>>> user/pass authentication.. can anyone point me to a script that works
>>> and is simple for
>>> 1- send an email directly (problem with below is email never shows up
>>> at destination)
>> Does this help you?http://www.physik.fu-berlin.de/~goerz/programs/mailpl/mailpl.html
>>
>> Michael Goerz
>
> Hi excellent for those looking for all the bells and whistles
> (encryption, etc etc) - good work .however way too much code,
> complexity, dependencies requiring install, etc for me,
You can try to comment out some of the dependencies. You can definitely
get rid of 'use Mail::GPG;' and 'use Archive::Zip qw( :ERROR_CODES
:CONSTANTS );'. The program will fail if you actually use encryption or
zipped attachments, of course, but you should be find for you basic
functionality. Most of the other dependencies are probably essential,
all the network communication stuff. You can play around with commenting
out any of them, see what works and and doesn't.... But, there will
always be some dependencies left. What's the problem with using 'perl
-MCPAN'? Installing missing modules in Perl should be quite easy
> and when I got
> it to run, ctrl-D didnt work..
You're on Windows, right?... I don't think I ever tested the script on
Windows. It should work though. crtl+D is supposed to end standard
input. It's not a feature of the script, but of the shell. There's got
to be something equivalent on Windows. But, entering the email text on
the console is only a fallback anyway. You should call an editor for
that (--editor=notepad). It's best to set this up in the config file.
(at "$ENV{HOME}/.mailpl/mailpl.rc" by default, but you can change that
at the beginning of the script).
Next time I'll be on a Windows machine, I'll try to find out what's up
with this CTRL+D... it might be a while, though.
> is there anyway you can post a very
> stripped down version that just does the very basic with basic user
> authentication so I can run this ?
Not really. Try commenting out dependencies if you must. You'll still
need some modules, which are all easily available.
> perl testemail4.pl --to=guy@gmail.com --from=steve@sss.com --s
> ubject=test --host=smtp.sss.com --port=25 --user=steve --pass=8989dud3
I hope that's not your real password!
> Thank you,
> Jack
Good luck,
Michael
------------------------------
Date: Tue, 11 Mar 2008 23:52:26 -0400
From: Michael Goerz <newsgroup898sfie@8439.e4ward.com>
Subject: Re: How to send email with perl, or at least control Outlook Express
Message-Id: <63p2bqF287v6dU1@mid.uni-berlin.de>
Michael Goerz wrote, on 03/11/2008 06:23 PM:
> Jack wrote, on 03/11/2008 03:59 PM:
>> On Mar 11, 11:08 am, Michael Goerz <newsgroup898s...@8439.e4ward.com>
>> wrote:
>>> Jack wrote, on 03/11/2008 11:39 AM:
>>>
>>>> Hi for some reason I can send email and the target receives it with my
>>>> James mailserver via Outlook Express, but not via BLAT. I am using
>>>> user/pass authentication.. can anyone point me to a script that works
>>>> and is simple for
>>>> 1- send an email directly (problem with below is email never shows up
>>>> at destination)
>>> Does this help
>>> you?http://www.physik.fu-berlin.de/~goerz/programs/mailpl/mailpl.html
>>>
>>> Michael Goerz
>>
>> Hi excellent for those looking for all the bells and whistles
>> (encryption, etc etc) - good work .however way too much code,
>> complexity, dependencies requiring install, etc for me,
> You can try to comment out some of the dependencies. You can definitely
> get rid of 'use Mail::GPG;' and 'use Archive::Zip qw( :ERROR_CODES
> :CONSTANTS );'. The program will fail if you actually use encryption or
> zipped attachments, of course, but you should be find for you basic
> functionality. Most of the other dependencies are probably essential,
> all the network communication stuff. You can play around with commenting
> out any of them, see what works and and doesn't.... But, there will
> always be some dependencies left. What's the problem with using 'perl
> -MCPAN'? Installing missing modules in Perl should be quite easy
> > and when I got
> > it to run, ctrl-D didnt work..
> You're on Windows, right?... I don't think I ever tested the script on
> Windows. It should work though. crtl+D is supposed to end standard
> input. It's not a feature of the script, but of the shell. There's got
> to be something equivalent on Windows. But, entering the email text on
> the console is only a fallback anyway. You should call an editor for
> that (--editor=notepad). It's best to set this up in the config file.
> (at "$ENV{HOME}/.mailpl/mailpl.rc" by default, but you can change that
> at the beginning of the script).
>
> Next time I'll be on a Windows machine, I'll try to find out what's up
> with this CTRL+D... it might be a while, though.
I just googled it. On Windows, you have to press CTRL+Z instead of CTRL+D:
http://www.mhuffman.com/notes/dos/bash_cmd.htm
------------------------------
Date: Tue, 11 Mar 2008 11:57:00 -0700 (PDT)
From: kwalike57 <karinwalike@comcast.net>
Subject: Re: How to submit an HTTP Request with XML
Message-Id: <0891a591-0241-45b7-90cf-2690d641292c@s13g2000prd.googlegroups.com>
On Mar 10, 11:06=A0am, "J. Gleixner" <glex_no-s...@qwest-spam-
no.invalid> wrote:
> kwalike57 wrote:
> > Hello. =A0I need to build a process in an existing Perl script the
> > submits an http request with some XML.
>
> > I have never done this in Perl and I need to know which modules to use
> > and how to compose the syntax in the script to send this request.
>
> [...]
>
> To POST something via HTTP, you could start with LWP:
>
> perldoc lwpcook
so would I just use LWP; or LWP::Simple;? Also, would I just do a
straight $httprequest =3D get("http://ppld.corp.sprint.com/wlsapps2/
livelink_wls/Upload91?control=3D<?xml
version=3D"1.0" encoding=3D"ISO-8859-1"?><LIVELINKUPLOAD ID=3D"1"><LOADINFO
Host=3D"DOC-SHARE" LOGIN=3D"xxxxxxx" PASSWORD=3D"xxxxxxx"
DELETESOURCE=3D"TRUE" OUTPUT=3D"XML" LOADTYPE=3D"PATH"/><FILEINFO
FILENAME=3D"TRS_926106383.pdf"
FTPFILENAME=3D"926106383.pdf"><FOLDERPATH><FOLDER
FOLDERNAME=3D"Information Technology"/></FOLDERPATH><FOLDERPATH><FOLDER
FOLDERNAME=3D"IT Billing and Customer Care Systems (CBS)"/></
FOLDERPATH><FOLDERPATH><FOLDER FOLDERNAME=3D"CBS - Customer Billing
Services"/></FOLDERPATH><FOLDERPATH><FOLDER FOLDERNAME=3D"TRS Billing"/
></FOLDERPATH><FOLDERPATH><FOLDER FOLDERNAME=3D"2007"/></
FOLDERPATH><FOLDERPATH><FOLDER FOLDERNAME=3D"Invoices"/></FOLDERPATH></
FILEINFO></LIVELINKUPLOAD>"); or actually $httprequest =3D get($url .
$xmldata); ??
What do you think?
Thanks!
Karin Walike
------------------------------
Date: Tue, 11 Mar 2008 19:17:07 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: How to submit an HTTP Request with XML
Message-Id: <je2ja5-bfl1.ln1@osiris.mauzo.dyndns.org>
Quoth kwalike57 <karinwalike@comcast.net>:
> Hello. I need to build a process in an existing Perl script the
> submits an http request with some XML.
>
> I have never done this in Perl and I need to know which modules to use
> and how to compose the syntax in the script to send this request.
>
> Here is what the fully composed request needs to look like:
>
> http://ppld.corp.sprint.com/wlsapps2/livelink_wls/Upload91?control=<?xml
> version="1.0" encoding="ISO-8859-1"?><LIVELINKUPLOAD ID="1"><LOADINFO
<snip yards of XML>
>
> If I paste this request string into a browser from the host machine
> where the Perl script will run from it executes perfectly, basically
> taking the .pdf file named in the command and uploading it to an
> online document library called Doc-Share where it is then viewable to
> users who log in.
That isn't a valid URL. At the very least all those spaces and
question-marks need escaping; also, I seriously doubt you're meant to
use a URL that long. I suspect you're meant to use POST instead of GET,
especially as a non-reversible action like uploading a file should be a
POST anyway (caches are required to pass POSTs on unmolested; this is
not true of GETs). Probably it only works from the browser by accident: the
browser 'helpfully' fixes your URL for you, and the server doesn't check
that you used the correct HTTP method.
Probably what you want is something like
use LWP;
my $url = # note this *doesn't* have ?content= on the end
"http://ppld.corp.sprint.com/wlsapps2/livelink_wls/Upload91";
my $xml = <<XML;
<?xml version="1.0"?>
...
XML
my $UA = LWP::UserAgent->new;
my $resp = $UA->post($url, content => $xml);
$resp->is_success or die "POST failed: " . $resp->status_line;
Ben
------------------------------
Date: Tue, 11 Mar 2008 16:49:15 -0700 (PDT)
From: ShaunJ <sjackman@gmail.com>
Subject: Matching multiple subexpressions in a regular expression
Message-Id: <d083d36a-af92-4413-b1ea-769090837a0e@e25g2000prg.googlegroups.com>
If more than one subepxression of a regex could have matched the
string, is it possible to find all the subexpressions that could have
matched? Example...
my $re = qr/([AC]CT)|(AC[CT])/;
'CCT' =~ m/$re/;
print join ',', @-; print "\n";
'ACC' =~ m/$re/;
print join ',', @-; print "\n";
'ACT' =~ m/$re/;
print join ',', @-; print "\n";
Output:
0,0
0,,0
0,0
This shows that for...
CCT: the first subexpression matched
ACC: the second subexpression matched
ACT: the first subexpression matched
However, ACT matched both subexpressions! The ideal result for ACT
would be...
0,0,0
showing that both subexpressions matched. Is this possible without
having to split each subexpression into its own regular expression? My
understanding -- please correct me if I'm wrong -- is that one big
regular expression will run faster than 100 little ones, since the one
big regular expression can be compiled into a single large finite-
state-machine that is more efficient than running 100 little FSM.
Thanks!
Shaun
------------------------------
Date: Wed, 12 Mar 2008 01:13:52 GMT
From: "John W. Krahn" <someone@example.com>
Subject: Re: Matching multiple subexpressions in a regular expression
Message-Id: <k7GBj.100243$C61.89884@edtnps89>
ShaunJ wrote:
> If more than one subepxression of a regex could have matched the
> string, is it possible to find all the subexpressions that could have
> matched? Example...
>
> my $re = qr/([AC]CT)|(AC[CT])/;
> 'CCT' =~ m/$re/;
> print join ',', @-; print "\n";
> 'ACC' =~ m/$re/;
> print join ',', @-; print "\n";
> 'ACT' =~ m/$re/;
> print join ',', @-; print "\n";
>
> Output:
> 0,0
> 0,,0
> 0,0
>
> This shows that for...
> CCT: the first subexpression matched
> ACC: the second subexpression matched
> ACT: the first subexpression matched
>
> However, ACT matched both subexpressions! The ideal result for ACT
> would be...
> 0,0,0
> showing that both subexpressions matched.
Perl's regular expressions can't do that. They always stop after a
successful match so either ([AC]CT) would match or (AC[CT]) would match
but never both.
> Is this possible without
> having to split each subexpression into its own regular expression? My
> understanding -- please correct me if I'm wrong -- is that one big
> regular expression will run faster than 100 little ones,
Your assumption is incorrect.
> since the one
> big regular expression can be compiled into a single large finite-
> state-machine that is more efficient than running 100 little FSM.
That question is answered in perlfaq6:
perldoc -q "How do I efficiently match many regular expressions at once"
John
--
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order. -- Larry Wall
------------------------------
Date: Tue, 11 Mar 2008 21:59:22 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: regexp for s///
Message-Id: <eksdt3p91hvh5dqlnfgm855k2p2g4p0vmc@4ax.com>
On Mon, 10 Mar 2008 13:59:19 -0800, David Filmer
<usenet@davidfilmer.com> wrote:
>> give ($string) {
>> when ("A: aaa B: bbb") {
>
>Is that Perl6?
No, it's Perl 5.10, but it should be C<given>, anyway.
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: 11 Mar 2008 21:46:38 GMT
From: Abigail <abigail@abigail.be>
Subject: Re: regular expression with split goes wrong ?
Message-Id: <slrnftdvdt.154.abigail@alexandra.abigail.be>
_
Jim Gibson (jimsgibson@gmail.com) wrote on VCCCVI September MCMXCIII in
<URL:news:110320081053544211%jimsgibson@gmail.com>:
~~ In article
~~ <2e65c757-6a66-4edd-94de-e58afb20d6d8@u69g2000hse.googlegroups.com>,
~~ Riad KACED <riad.kaced@gmail.com> wrote:
~~
~~ > I would propose the following for your case :
~~ > @num = split /D+/,$x;
~~
~~ You left out one backslash:
~~
~~ split /\D+/,$x;
~~
~~ > This will split with any a-zA-Z
~~
~~ Actually, \D stands for [^0-9], which is much larger than [a-zA-z] and
~~ includes a lot of punctuation characters.
Well, it's not that simple.
If *both* the pattern *and* the subject (the string matched against)
are not in UTF-8, then, and only then, does \D equal [^0-9].
However, if either of them is in UTF-8 format (which does not necessarely
mean they contain a non-ASCII character), then \D excludes a lot more
than just the digits 0 to 9.
$ perl -wE 'chr =~ /[^0-9]/ or $c ++ for 0x00 .. 0xD7FF; say $c'
10
$ perl -wE 'chr =~ /\D/ or $c ++ for 0x00 .. 0xD7FF; say $c'
220
In fact, using \d (\D) as a shortcut for [0-9] ([^0-9]) is often just
plain wrong.
Abigail
--
# Perl 5.6.0 broke this.
%0=map{reverse+chop,$_}ABC,ACB,BAC,BCA,CAB,CBA;$_=shift().AC;1while+s/(\d+)((.)
(.))/($0=$1-1)?"$0$3$0{$2}1$2$0$0{$2}$4":"$3 => $4\n"/xeg;print#Towers of Hanoi
------------------------------
Date: Tue, 11 Mar 2008 20:17:29 -0700 (PDT)
From: "benkasminbullock@gmail.com" <benkasminbullock@gmail.com>
Subject: Re: Setting up mod_perl
Message-Id: <b0d9acb6-30b4-4c9e-9e63-f3b5467e0a7d@s37g2000prg.googlegroups.com>
On Mar 11, 3:37 am, asmita.jo...@gmail.com wrote:
> Anyone have any clues what is going wrong with my apache/modperl
> configuration?
One problem which might be occurring is that mod_perl doesn't like
running files which are viewable by the web server (under /var/htdocs/
or similar). So if your file is in a place where it can be served up
as if it was an HTML file, then mod_perl refuses to run it as a
script.
That doesn't seem to be the case from what you described, but it might
be worth checking.
------------------------------
Date: Tue, 11 Mar 2008 19:13:23 -0700 (PDT)
From: "benkasminbullock@gmail.com" <benkasminbullock@gmail.com>
Subject: Re: Starting a Perl script with no command prompt window
Message-Id: <bc173e40-6f6d-40d7-94b9-9d1b0065136d@e10g2000prf.googlegroups.com>
PeteOlcott $B$N%a%C%;!<%8(B:
> Does anyone know how to start a Perl script as an MS Windows XP Pro
> "Scheduled Task" and either have no "command prompt" window, or have
> the "command prompt" window be created as minimized?
There are several solutions for removing the command prompt window
here:
http://www.perlmonks.org/?node_id=536260
------------------------------
Date: Tue, 11 Mar 2008 12:10:24 -0700
From: pauls <pauls@nospam.off>
Subject: Re: text substitution question
Message-Id: <eo6dnW621rmlREvanZ2dnUVZ_hGdnZ2d@seanet.com>
pauls wrote:
> I am trying to figure-out how to eliminate any occurrences of the
> following text:
>
> </font>
>
> in a text file.
>
> Usually I try to do some operation on the input file $_ like this:
>
> s/</font>//g;
>
> But, this does not eliminate the text.
>
>
> Any help appreciated!
>
> Thanks!
>
> P.
Thanks folks, much apprecaited!
P.
------------------------------
Date: Tue, 11 Mar 2008 01:57:02 +0100
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: text substitution question
Message-Id: <fr4ovf.1h4.1@news.isolution.nl>
pauls schreef:
> I am trying to figure-out how to eliminate any occurrences of the
> following text: </font> in a text file.
> Usually I try to do some operation on the input file $_ like this:
> s/</font>//g;
> But, this does not eliminate the text.
When a string contains a slash, you need to either
choose a different separator in the substitute
command, like s#</font>##g, or escape the slash,
like s/<\/font>//g. I prefer the first.
--
Affijn, Ruud
"Gewoon is een tijger."
------------------------------
Date: Tue, 11 Mar 2008 11:14:37 -0700 (PDT)
From: Mr_Noob <gniagnia@gmail.com>
Subject: Re: timeout problem with Net::Telnet
Message-Id: <5c511c9c-53f4-4701-8acd-822b7761a5a2@i7g2000prf.googlegroups.com>
On 11 mar, 16:15, "J. Gleixner" <glex_no-s...@qwest-spam-no.invalid>
wrote:
> Mr_Noob wrote:
> > Hi all,
>
> > Here is my perl script that make a telnet connection with a windows2k3
> > box :
>
> > #!/usr/bin/perl -w
> > use strict;
> > use warnings;
> > use Net::Telnet ();
> > my $telnet = new Net::Telnet ( Timeout=>10, Errmode=>'die', Prompt =>
> > '/\$ $/i');
>
> That's saying that you want a prompt that ends with a '$ '.
>
> [...]
>
> > I guess my "Prompt" isn't set correctly but can't find how to correct
> > this...
>
> You change the regular expression of the Prompt attribute above.
>
> > Here is how it looks like if i telnet my server manually :
>
> > $ telnet myserver
> > Trying 192.168.1.6...
> > Connected to myserver.mydomain.com.
> > Escape character is '^]'.
> > Welcome to Microsoft Telnet Service
>
> > login: administrator
> > password:
>
> Your prompt on the remote machine would be the 'login: ', then the
> 'password: '.
>
> Modify your Prompt to match what you're seeing on the remote machine.
ok, thx for the advise.
But i tried this :
my $telnet = new Net::Telnet ( Timeout=>10, Errmode=>'die', Prompt =>
'/login: $/i');
or
my $telnet = new Net::Telnet ( Timeout=>10, Errmode=>'die', Prompt =>
'/password:$/i');
my $telnet = new Net::Telnet ( Timeout=>10, Errmode=>'die', Prompt =>
'/login:|password:$/i');
without any success.....
------------------------------
Date: Tue, 11 Mar 2008 18:53:44 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: timeout problem with Net::Telnet
Message-Id: <o21ja5-ugk1.ln1@osiris.mauzo.dyndns.org>
Quoth "J. Gleixner" <glex_no-spam@qwest-spam-no.invalid>:
> Mr_Noob wrote:
> >
> > Here is my perl script that make a telnet connection with a windows2k3
> > box :
Have you read the notes in Net::Telnet about Microsoft's telnet server?
> > #!/usr/bin/perl -w
> > use strict;
> > use warnings;
> > use Net::Telnet ();
> > my $telnet = new Net::Telnet ( Timeout=>10, Errmode=>'die', Prompt =>
Using 'indirect object syntax' (new Net::Telnet (...)) is a bad idea.
Perl's parsing of it is somewhat flakey, and it's better to use normal
object syntax:
my $telnet = Net::Telnet->new(...);
> > '/\$ $/i');
>
> That's saying that you want a prompt that ends with a '$ '.
<snip>
>
> Your prompt on the remote machine would be the 'login: ', then the
> 'password: '.
No, it wouldn't. Net::Telnet handles the login prompts itself. The
prompt on a Win32 machine is something like qr/\\>$/ or qr/\\> $/: whatever
the shell prints just before you enter a command.
Ben
------------------------------
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 V11 Issue 1355
***************************************