[11314] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 4914 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Feb 17 11:07:19 1999

Date: Wed, 17 Feb 99 08:00:34 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 17 Feb 1999     Volume: 8 Number: 4914

Today's topics:
    Re: Announce: Perl Function Repository (was Re: Calcula (Markus Laker)
    Re: Announce: Perl Function Repository (sthoenna@efn.org)
        client-server problem <hagay.perlmutter@orange.co.il>
        converting special control characters ritakens@my-dejanews.com
        GetOptions and multiple, identical options (Gary L. Hennigan)
    Re: good code vs code that works <23_skidoo@geocities.com>
    Re: greedy operators - help! <Philip.Newton@datenrevision.de>
        HELP! Why is this not working? see_my_sig@to_email_me.ca
    Re: HELP! Why is this not working? <Tony.Curtis+usenet@vcpc.univie.ac.at>
    Re: HELP! Why is this not working? <jacklam@math.uio.no>
    Re: Help,,, (Apache server) (Clay Irving)
    Re: Help,Perl Script doesn't work! (Larry Rosler)
    Re: how do I get a date in perl? <jpm0932@my-dejanews.com>
    Re: How to determine if binary info in a string <jacklam@math.uio.no>
        How2 ! Expand Command Line Argument Wildcards? <rbobo@spd.dsccc.com>
    Re: How2 ! Expand Command Line Argument Wildcards? <Tony.Curtis+usenet@vcpc.univie.ac.at>
    Re: none <revjack@radix.net>
    Re: none (Bart Lateur)
        Parsing <trenic@nortelnetworks.ca>
        Parsing <trenic@nortelnetworks.ca>
    Re: Parsing (Larry Rosler)
        Perl (cgi) gateway to the as400/WSG <ping@alt.it>
        perl programmer in atlanta <mcourter@mindspring.com>
        perl programmer <mcourter@mindspring.com>
        perl+DB error <Marius.Panait@Romania.EU.net>
        perl/tk for win95 (Allen Septon)
    Re: PFR: UTC_to_Epoch <tam@silk.gsfc.nasa.gov>
    Re: PFR: UTC_to_Epoch (M.J.T. Guy)
        regex poll <uri@ibnets.com>
    Re: Regular expression for Currency ??? <jwarner@tivoli.com>
    Re: Speed Up Perl (Clay Irving)
    Re: Speed Up Perl (I R A Aggie)
    Re: STDERR of system call in variable? (Clay Irving)
        using perl <ww73@columbia.edu>
    Re: y2k problems with perl <jwarner@tivoli.com>
    Re: y2k problems with perl <ludlow@us.ibm.com>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Wed, 17 Feb 1999 00:20:34 GMT
From: lakerDeleteThisBit@tcp.co.uk (Markus Laker)
Subject: Re: Announce: Perl Function Repository (was Re: Calculate yesterdays date)
Message-Id: <36d30938.49863549@news.tcp.co.uk>

pshank@systems.dhl.com wrote:

> In article <m3d83g92nf.fsf_-_@moiraine.dimensional.com>,
>   Daniel Grisinger <dgris@moiraine.dimensional.com> wrote:

> > Daniel Grisinger          dgris@moiraine.dimensional.com
> > perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print
> > m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'

[...]

> When I execute your sig I get a compile-time error because perl can't find
> the re.pm module.  Am I missing something about how arguments to command-line
> switches are parsed?

I'm not Daniel, but I may be better placed to answer your question.

I see from your headers that you're using a Win32 system.  With Win32
ports of Perl, you have to use double rather than single quotes with the
-e command-line switch.  Change all four single quotes to doubles, like
this --

perl -Mre=eval -e"$_=shift;;@[=split//;;$,=qq;\n;;;print
m;(.{$-}(?{$-++}));,q;;while$-<=@[;;" "Just Another Perl Hacker"

-- and try again.

For more information, see 'Why don't perl one-liners work on my
DOS/Mac/VMS system?' in perlfaq3.

Markus

-- 
Delete the 'delete this bit' bit of my address to reply


------------------------------

Date: Wed, 17 Feb 1999 00:53:10 GMT
From: sthoenna@efn.org (sthoenna@efn.org)
Subject: Re: Announce: Perl Function Repository
Message-Id: <2Lhy2gzkgGSO092yn@efn.org>

In article <7acm3m$d5g$1@nnrp1.dejanews.com>, pshank@systems.dhl.com wrote:
>In article <m3d83g92nf.fsf_-_@moiraine.dimensional.com>,
>  Daniel Grisinger <dgris@moiraine.dimensional.com> wrote:
>
>> Daniel Grisinger          dgris@moiraine.dimensional.com
>> perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print
>> m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'
>
>When I execute your sig I get a compile-time error because perl can't find
>the re.pm module.  Am I missing something about how arguments to command-line
>switches are parsed?

Nope, he should have had:
perl -M5.005 -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print
m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'


------------------------------

Date: Wed, 17 Feb 1999 15:56:46 +0200
From: "Hagay Perlmutter" <hagay.perlmutter@orange.co.il>
Subject: client-server problem
Message-Id: <7aehp0$c85$1@news2.inter.net.il>

Hi all,

I'm new to Perl and have a problem with sockets.

I would like to send and receive from/to Unix machine.

I used the text book examples as shown below:

Server Part:
#!/usr/local/bin/perl -w

require 5.002;
use Socket;
use strict;
use Carp;

BEGIN { $ENV{PATH} = '/usr/bin:/bin' }

my ( $NAME ) = '/tmp/usock';
my ( $uaddr ) = sockaddr_un( $NAME );
my ( $proto ) = getprotobyname( 'tcp');
my ( $paddr ) = "";

socket( Server, PF_UNIX, SOCK_STREAM, 0) || die "socket: $!\n";
unlink( $NAME );
bind( Server, $uaddr ) || die "bind: $!\n";
listen( Server, SOMAXCONN ) || die "listen: $!\n";

print "Server starter on $NAME";
#logmsg "Server starter on $NAME";

$SIG{CHLD} = \&REAPER;

for( ; $paddr = accept(Client, Server); close Client) {
 #logmsg "connection on $NAME";
 print "connection on $NAME";
 &connected();
}

sub connected {
print "Hellow there, ", scalar localtime, "\n";
}

Client Part:
#!/usr/local/bin/perl -w

require 5.002;
use Socket;
use strict;
use Carp;

my ( $ran, $line, $remote );

$ran = shift || 'tmp/usock';
socket( SOCK, PF_UNIX, SOCK_STREAM, 0 ) || die "socket: $!\n";
connect( SOCK, sockaddr_un( $remote )) || die "connect $!\n";

while( $line = <SOCK> ) {
 print $line;
}
exit;


Error received:

>From the server side
Bad arg length for Socket::unpack_sockaddr_un, length is 10, should be 110
at /usr/local/lib/perl5/sun4-solaris/5.00404/Socket.pm line 259.



>From the client side:
Value of <HANDLE> construct can be "0"; test with defined() at client line
65535.
Use of uninitialized value at
/usr/local/lib/perl5/sun4-solaris/5.00404/Socket.pm line 262.
connect No such file or directory

Do you have any idea what I did wrong?

Thanks a lot!





------------------------------

Date: Wed, 17 Feb 1999 15:01:28 GMT
From: ritakens@my-dejanews.com
Subject: converting special control characters
Message-Id: <7aelk2$2l3$1@nnrp1.dejanews.com>

I have a file that I need to know what the control characters mean and I have
not a clue as to where to look.  Some of the special characters are:
ctl-A
ctl-B
ctl-E
y's with double quotes above them
ctl-D
ctl-G

Any help would be appreciated.  Thanks in advance...

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


------------------------------

Date: 17 Feb 1999 08:18:29 -0700
From: gary@ieee.org (Gary L. Hennigan)
Subject: GetOptions and multiple, identical options
Message-Id: <sa73e45oy7u.fsf@chtorr.cs.sandia.gov>

I'm still learning Perl and while waiting for the book I ordered to
arrive I'm trying to figure this out. I have a script and I'm using
Getopt::Long to parse command-line options. I invoke my script like:

myscript.pl --dir=/usr/local --dir=/opt --debug=5

Within the script is:

%opts = ();
GetOptions(\%opts,
	"dir=s@",
	"debug:i);

if I print the contents of the hash I get:

dir=ARRAY(0x80c69a4)
debug=5

What I'd like to do is something like:

@dir_list = $opts{"dir"};

print $dir_list[0], ..., $dir_list[$#dir_list], "\n";

but apparently (I only found this out by experimenting, I don't quite
understand why) what I actually need to do is:

print $dir_list[0][0], $dir_list[0][1], ...

First, I didn't even know Perl supported doubly indexed arrays? Maybe
from what I've done it's just a side effect? Second, how do I get an
array of

@dir_list = ("/usr/local", "/opt");

from $opts{"dir"} ?

Thanks!
Gary


------------------------------

Date: Wed, 17 Feb 1999 14:35:38 +0000
From: 23_skidoo <23_skidoo@geocities.com>
Subject: Re: good code vs code that works
Message-Id: <36CAD3A5.21A8@geocities.com>

Tad McClellan wrote:
> 
> 23_skidoo (23_skidoo@geocities.com) wrote:
> :
> :       print "<a href=\"$homepage\" target=\"_top\">back</a><br>\n";
> 
>    Yuk!
> 
>    That is pretty hard to read.
> 
>    The next person that has to figure out what that does is going
>    to spend several seconds pondering that line, when you could
>    have written it the "one second to understand" way.
> 
>    That next person may even be you!
> 
>       print qq(<a href="$homepage" target="_top">back</a><br>\n);
> 
>    Easier to read, and less characters to type to boot.
> 

true i guess but i'm probably one of the few people in here programming
perl on a mac using bbedit. the text colouring (invaluable for newbies
like me, spotting almost all of my typos) picks up my version
recognising everything inside the "s as stuff to be printed as it
recognises when you escape a ", your version highlights only the words
"$homapage" and "_top"

for me it's much easier my way. anyone else? well.... i'll burn that
bridge when i come to it :)

-23


------------------------------

Date: Wed, 17 Feb 1999 15:13:59 +0100
From: Philip Newton <Philip.Newton@datenrevision.de>
Subject: Re: greedy operators - help!
Message-Id: <36CACEA7.1C2A2694@datenrevision.de>

Asterix wrote:
> 
> hmm... Alan brings up an interesting point I hadn't thought about... if I
> get a filename like: "/foo.bar/baz"  the solution below will/should return
> "/foo" when what one wants is "/foo.bar/baz".  so to wrap this up, I think
> the expression:
> 
>     s/\.[^.\/]*?$//;
> 
> should do it!

or even s!\.[^./]*?$!!; to save escaping the slash

Cheers,
Philip


------------------------------

Date: 17 Feb 1999 14:50:47 GMT
From: see_my_sig@to_email_me.ca
Subject: HELP! Why is this not working?
Message-Id: <7ael07$llh$1@bcarh8ab.ca.nortel.com>



Please help me find what is wrong with the piece below. I am going
NUTS!!! 

I have the following segment in a script that wants to extract some data
from a table in an html file. This piece is to skip the uninteresting
cells at the end of the table row.

    while (<QF>) {
    	print ">> $_";  #added to help me understand what's going on
	if (m'</tr'i) {$last;}
    }

The problem is that it just does not work. It happily reads through the
whole file running over many </tr> tags in the process.

Since I am new with Perl, I do not trust my understanding to be
complete. So I have tried a few things: changed delimiters, added
explicit $_ to match, quoted with \ various parts of the string, all to
no avail.

I have tried this in my Linux system at home with Perl version 5.004_04,
and at work on a Solaris with Perl version 5.004. Both are doing the
exactly the same wrong (in my judgement) thing.

Please feel free to post or e-mail as you see fit.

Thanks in advance.

-- 
--
  Yavuz Onder  |   yavuz aeT nortelnetworks dowT com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Opinions expressed are mine, NOT my employer's.


------------------------------

Date: 17 Feb 1999 16:16:03 +0100
From: Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
Subject: Re: HELP! Why is this not working?
Message-Id: <83n22djc24.fsf@vcpc.univie.ac.at>

Re: HELP! Why is this not working?, see
<see_my_sig@to_email_me.ca> said:

see> html file. This piece is to skip the
see> uninteresting cells at the end of the table
see> row.

see>     while (<QF>) { print ">> $_"; #added to
see> help me understand what's going on if
see> (m'</tr'i) {$last;} }

"$last;" ???

Are you sure that's what you want?

-- 
Tony Curtis, Systems Manager, VCPC,    | Tel +43 1 310 93 96 - 12; Fax - 13
Liechtensteinstrasse 22, A-1090 Wien.  | <URI:http://www.vcpc.univie.ac.at/>
"You see? You see? Your stupid minds!  | private email:
    Stupid! Stupid!" ~ Eros, Plan9 fOS.| <URI:mailto:tony_curtis32@hotmail.com>


------------------------------

Date: Wed, 17 Feb 1999 16:20:58 +0100
From: Peter John Acklam <jacklam@math.uio.no>
Subject: Re: HELP! Why is this not working?
Message-Id: <36CADE5A.14DC965B@math.uio.no>

see_my_sig@to_email_me.ca wrote:
> 
>     while (<QF>) {
>         print ">> $_";  #added to help me understand what's going on
>         if (m'</tr'i) {$last;}
>     }

That should probably be `last', not `$last'.

Do you run your scripts with the `-w' switch turned on?
If not, do it.

Hope this helps.

-- 
Peter J. Acklam - jacklam@math.uio.no - http://www.math.uio.no/~jacklam


------------------------------

Date: 17 Feb 1999 09:06:06 -0500
From: clay@panix.com (Clay Irving)
Subject: Re: Help,,, (Apache server)
Message-Id: <7aeice$i9o$1@panix.com>

In <19990217072636.18614.00002874@ng04.aol.com> bababozorg@aol.com (Bababozorg) writes:

>i installed apache web server in my comp but i cant make it read the cgi or
>perl scripts it just give me 500 Internal Server Error every time i run the
>scripts.
>i think i have to write the address or perl.exe somewhere but i dont know where
>to write that
>can you help me please

 ...Not that this has anything to do with Perl, but did you check the
error message in the error log file? -- What did it indicate the problem was?

-- 
Clay Irving
clay@panix.com


------------------------------

Date: Wed, 17 Feb 1999 07:11:58 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Help,Perl Script doesn't work!
Message-Id: <MPG.11347c0e4067f67989a4e@nntp.hpl.hp.com>

In article <Webmaster-1602992208550001@whaserv.demon.co.uk> on Tue, 16 
Feb 1999 22:08:55 +0000, Simon Roulstone <Webmaster@KILL-MEquorndon-
mag.org.uk> says...
> Do I take it `perldoc -f binmode` is a bit of code I should insert into my
> script somewhere?, like I said I'm very new at all this stuff.

It is shorthand used in this newsgroup, aiming you at the documentation 
of the Perl function 'binmode'.  As written, it is a command that 
executes on a Unix-based system.

If you don't have a Unix-based perl installation at hand, all the Perl 
documentation is readily available from the Web, starting at 
<URL:http://www.perl.com/> which is a resource you want to become 
familiar with.

> I also found out that the server is running the following if its any help.
> WinNT4, Perl 5.(something), IIS Web Server (latest version with
> Options Pack for NT).

Too bad.  You'll just have to live with it, as many of us do.  :-(

-- 
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


------------------------------

Date: Wed, 17 Feb 1999 14:12:13 GMT
From: Joe Meree <jpm0932@my-dejanews.com>
Subject: Re: how do I get a date in perl?
Message-Id: <7aeinm$vvt$1@nnrp1.dejanews.com>

It would be hard to get a date in Perl because most programmers
are guys.  However, you should include a lot of romantic comments
in your scripts.  Then when that special someone reads your script
they will like you and want to go on a date with you...


In article <1dmzj9b.1mir3okdgax8sN@bay2-161.quincy.ziplink.net>,
  rjk@linguist.dartmouth.edu (Ronald J Kimball) wrote:
> Duc Le <bamboo@best.com> wrote:
>
> > Subject: how do I get a date in perl?
>
> Sorry, Perl is for computer programmers, who are widely known not to get
> dates.  If you want to get a date, try something more glamorous, like
> racecar driving.
>
> --
>  _ / '  _      /         - aka -          rjk@linguist.dartmouth.edu
> ( /)//)//)(//)/(     Ronald J Kimball      chipmunk@m-net.arbornet.org
>     /                                  http://www.ziplink.net/~rjk/
> perl -e'$_="\012534`!./4(%2`\cp%2,`(!#+%2j";s/./"\"\\c$&\""/gees;print'
>

Joe Meree

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


------------------------------

Date: Wed, 17 Feb 1999 02:34:34 +0100
From: Peter John Acklam <jacklam@math.uio.no>
Subject: Re: How to determine if binary info in a string
Message-Id: <36CA1CAA.8DF1552B@math.uio.no>

Michael Shavel wrote:
> 
> I need to determine if there is any binary info within a given string.
> (...)
> I know there must be a simple way to do this.

As far as I know there are, for instance, no bullet-proof methods to
find out whether a file is text or binary.  But you can easily find
out whether a files is most likely text or binary, and it's better
to err on the safe side and say a file is binary rather than text.

Anyway, when I need to find out whether some piece of data is binary
or text I use something like

    if ( $data =~ /[\000-\007\016-\037\200-\237]/ ) {
        print "binary\n";
    } else {
        print "text\n";
    }

This "allows" text files that contain eight-bit characters and
characters such as form-feed, carriage return, newline, tabs etc.

If you don't want to allow eight-bit characters, use the character
class [\000-\007\016-\037\200-\377] in stead.

Peter

-- 
Peter J. Acklam - jacklam@math.uio.no - http://www.math.uio.no/~jacklam




------------------------------

Date: Wed, 17 Feb 1999 08:43:19 -0600
From: Richard Bobo <rbobo@spd.dsccc.com>
Subject: How2 ! Expand Command Line Argument Wildcards?
Message-Id: <36CAD587.84398614@spd.dsccc.com>

I am trying to use command line arguments that can have wild cards, but
I don't want them expanded in @ARGV because I want to expand them later
while accessing a remote file system.  How can I get the raw or
unexpanded command line that launched the perl script?  Thanks in
advance for you help.

-Bobo

*** The opinions expressed are not those of Alcatel USA, Inc ***





------------------------------

Date: 17 Feb 1999 15:55:46 +0100
From: Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
Subject: Re: How2 ! Expand Command Line Argument Wildcards?
Message-Id: <83ogmtjczx.fsf@vcpc.univie.ac.at>

Re: How2 ! Expand Command Line Argument Wildcards?,
Richard <rbobo@spd.dsccc.com> said:

Richard> I am trying to use command line arguments
Richard> that can have wild cards, but I don't want
Richard> them expanded in @ARGV because I want to
Richard> expand them later while accessing a remote
Richard> file system.  How can I get the raw or
Richard> unexpanded command line that launched the
Richard> perl script?

That's a question for a group related to the
platform you're running perl from...

(*nix: you have to quote meta-chars in the shell).

hth
tony
-- 
Tony Curtis, Systems Manager, VCPC,    | Tel +43 1 310 93 96 - 12; Fax - 13
Liechtensteinstrasse 22, A-1090 Wien.  | <URI:http://www.vcpc.univie.ac.at/>
"You see? You see? Your stupid minds!  | private email:
    Stupid! Stupid!" ~ Eros, Plan9 fOS.| <URI:mailto:tony_curtis32@hotmail.com>


------------------------------

Date: 17 Feb 1999 14:18:48 GMT
From: Fernando Tanzania <revjack@radix.net>
Subject: Re: none
Message-Id: <7aej48$rrl$1@news1.Radix.Net>
Keywords: Hexapodia as the key insight

Abigail explains it all:

:soft4u@bigfoot.com (soft4u@bigfoot.com) wrote on MCMXCIII September
:MCMXCIII in <URL:news:99214941.00031@mail.nomailserver.com>:
::: 
::: Hi,
::: We have for sale various apps for the PC.
::: All softwares with removed the protection.
::: 
::: WORLD CONSTRUCTION SET v3

:Now, given that God had WORLD CONSTRUCTION SET v1, and you have
:WORLD CONSTRUCTION SET v3, who had version 2?

Charlemagne?

:perl -wle 'print "Prime" if (0 x shift) !~ m 0^\0?$|^(\0\0+?)\1+$0'

Use of uninitialized value at -e line 1.

-- 
  /~\  basis substitution strategy McGuire Miocene curvature fully pro
 C oo  audio therein solecism boor roe crimp lens Univac porridge frui
 _( ^) 1 , 0 0 0 , 0 0 0   m o n k e y s   c a n ' t   b e   w r o n g
/___~\ http://3509641275/~revjack  02/17/99 09:15:54 revjack@radix.net


------------------------------

Date: Wed, 17 Feb 1999 14:54:46 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: none
Message-Id: <36cbd7a7.23122381@news.skynet.be>

Abigail wrote:

>Now, given that God had WORLD CONSTRUCTION SET v1, and you have
>WORLD CONSTRUCTION SET v3, who had version 2?

You could ask pretty much the same question with regards to M$. They
don't mind jumping from version 2 to 7 (Access), or from 2 to 6 (Word).
"Visual C++" skipped some numbers too, I think.

	Bart.


------------------------------

Date: Wed, 17 Feb 1999 09:44:40 -0500
From: Tom Renic <trenic@nortelnetworks.ca>
Subject: Parsing
Message-Id: <36CAD5D8.5E537110@nortelnetworks.ca>

Thank you both for your help but for some reason it still won't work,
the output I get is:

Tom Renic~trenic@nortelnetworks.com~123456~Tom Renic~123 Easude Way
,Dallas, Texas
,1232~Tom Renic~...

Rather than:

Tom Renic~trenic@nortelnetworks.com~123456~Tom Renic~123 Easude Way,
Dallas,
Texas, 1232~Tom Renic~...

I used the tr code you provided it still didn't work. Any clues?


Larry Rosler wrote:

> In article <Pine.A41.4.02.9902151805330.36014-
> 100000@ginger.libs.uga.edu> on Mon, 15 Feb 1999 18:16:12 -0500, Brad
> Baxter <bmb@ginger.libs.uga.edu> says...
> > On Mon, 15 Feb 1999, Tom Renic wrote:
> > >                # The problem begins when I get to the
$OfficeAddress
> > > variable, since an address has usually more than one
> > >                # line, seperated by enter characters. What I would
like
> > > to do is replace the enter strokes with a comma.
> >
> > Try 'split' and 'join':
> ...
> >     join( ",", split( /\n/, $OfficeAddress ) ),
>
> That is painfully slow and complicated compared to 'tr':
>
>     $OfficeAddress =~ tr/\n/,/;
>
> --
> (Just Another Larry) Rosler
> Hewlett-Packard Company
> http://www.hpl.hp.com/personal/Larry_Rosler/
> lr@hpl.hp.com





------------------------------

Date: Wed, 17 Feb 1999 09:45:57 -0500
From: Tom Renic <trenic@nortelnetworks.ca>
Subject: Parsing
Message-Id: <36CAD625.BFF2AA21@nortelnetworks.ca>

Thank you both for your help but for some reason it still won't work,
the output I get is:

Tom Renic~trenic@nortelnetworks.com~123456~Tom Renic~123 Easude Way
,Dallas, Texas
,1232~Tom Renic~...

Rather than:

Tom Renic~trenic@nortelnetworks.com~123456~Tom Renic~123 Easude Way,
Dallas,
Texas, 1232~Tom Renic~...

I used the tr code you provided it still didn't work. Any clues?


Larry Rosler wrote:

> In article <Pine.A41.4.02.9902151805330.36014-
> 100000@ginger.libs.uga.edu> on Mon, 15 Feb 1999 18:16:12 -0500, Brad
> Baxter <bmb@ginger.libs.uga.edu> says...
> > On Mon, 15 Feb 1999, Tom Renic wrote:
> > >                # The problem begins when I get to the
$OfficeAddress
> > > variable, since an address has usually more than one
> > >                # line, seperated by enter characters. What I would
like
> > > to do is replace the enter strokes with a comma.
> >
> > Try 'split' and 'join':
> ...
> >     join( ",", split( /\n/, $OfficeAddress ) ),
>
> That is painfully slow and complicated compared to 'tr':
>
>     $OfficeAddress =~ tr/\n/,/;
>
> --
> (Just Another Larry) Rosler
> Hewlett-Packard Company
> http://www.hpl.hp.com/personal/Larry_Rosler/
> lr@hpl.hp.com





------------------------------

Date: Wed, 17 Feb 1999 07:29:25 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Parsing
Message-Id: <MPG.1134802a27e318fe989a4f@nntp.hpl.hp.com>

[Posted and a courtesy copy mailed.]

In article <36CAD625.BFF2AA21@nortelnetworks.ca> on Wed, 17 Feb 1999 
09:45:57 -0500, Tom Renic <trenic@nortelnetworks.ca> says...
> Thank you both for your help but for some reason it still won't work,
> the output I get is:
> 
> Tom Renic~trenic@nortelnetworks.com~123456~Tom Renic~123 Easude Way
> ,Dallas, Texas
> ,1232~Tom Renic~...
> 
> Rather than:
> 
> Tom Renic~trenic@nortelnetworks.com~123456~Tom Renic~123 Easude Way,
> Dallas,
> Texas, 1232~Tom Renic~...
> 
> I used the tr code you provided it still didn't work. Any clues?

Can you post the exact code and data that "still won't work"?  A 
few lines that constitute a complete program would be best.  Please cut-
and-paste them into your response, to avoid gratuitous typos.

I'm sure we can work it out from there.

-- 
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


------------------------------

Date: Wed, 17 Feb 1999 16:03:27 +0100
From: Giancarlo Pinerolo <ping@alt.it>
To: nbrion@box.seven.it
Subject: Perl (cgi) gateway to the as400/WSG
Message-Id: <36CADA3F.1DC956C@alt.it>

This is a multi-part message in MIME format.
--------------C41F0F522DDE6336BF0BB1B2
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

AS400 has ann automatic translation tool, called AS400 HTML Gateway
(somewhere is also
called WSG: Workstation Gateway). 
What it does is to automatically translate any 5250 screen into HTML
forms and serves them from a built in, (and very  peculiar) webserver. 

This is a dirty and quick gateway to pages served by the AS400
Workstation gateway (WSG)

This demo accesses the login WSG page and the following forms at
http://194.16.207.17:5061/WSG

to have it work at your  site you have to have WSG working on the AS
first, better with a dedicated user!
then you should be able to configure that user so that 'system messages'
are routed to somwhere else, otherwise you could get spurious screens
that say things like 'queue is allocated to another job' etc, which will
break the sequence.

the way my  'gateway to the WSG' works is this:
it gets the login page (http://194.16.207.17:5061/WSG, a demo of WSG
available on the web), parses and submits it and  all the following
pages until it gets to the real result page you wanna get. 
This is highly unefficient. Actually you could write an 'exit' for the
WSG  You can code this exit to bybass the login, and to parse any
GET string so as to call straight the desired program, but I didn't use
it because I  know nothing about the AS... In fact someone  else
installed and configured WSG for me.  

This example works from the console, but changing it to a CGI
is trivial. call it 'perl demo51.pl'on NT or just 'demo51.pl on unix

it will

1)
get the login page at 
http://194.16.207.17:5061/WSG
2)
parse it and subit it (via POST) with the proper fields initialized  
(login  'demo' user 'demo')
3)
get the firts page
4)
parse it and subit it (via POST) with the proper fields initialized  
(it will choose  '1' from the menu)
3)
get the second page
5)
parse it and subit it (via POST) with the proper fields initialized  
(it will choose  '2' from the menu)
6)
get the third (final) page
7)
parse it and load strings in anarray..Show them up
This is the real parsing step, and it has to be adapted to the proper
result page
It helps  if the result page contains some fixed  html tags so you can
identify what you need. You have to adapt it to your case   

Try that demo site with your browser first, to have  an  idea...
 
nedded perl modules
MD5-1.7.tar.gz
MIME-Base64-2.10.tar.gz
URI-1.00.tar.gz
URI-URL-4.16.tar.gz
libnet-1.0606.tar.gz
libwww-perl-5.36.tar.gz
HTML-Parser-2.22.tar.gz

you need to install them on unix in the standard (see the readme,
basically:
unpack each module in a tmp dir

perl Makefile.PL
make
make test
make install

there is a sequence in installing these,  I can't remember it, I tried
to list them in the right order. You'll get a message if prerequisites
are not satisfied anyway

if you want to test it on NT just install the activeState port of perl,
it already contains all the modules needed (http://www.activestate.com).
Download  their  'perl debugger' for NT, it's a great tool (you'll need
it to parse complicated form results) 

as of now it doesn't work through a socks firewall, but  Perl has
provision for that

it's surely badly-coded perl.

let me know, and maybe if you find some tricks,  improvements, share
them

gian
--------------C41F0F522DDE6336BF0BB1B2
Content-Type: application/x-perl; name="demo51.pl"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="demo51.pl"

#!/usr/bin/perl
#################################################
# COPYRIGHT
#
#  ) 1999 Giancarlo Pinero ping@alter.it
#  All rights reserved.
#
# This library is free software; you can redistribute it and/or modify
# it under the same terms as Perl itself.
######################################################################
use HTTP::Request::Common;
require LWP::UserAgent;
use HTML::TokeParser;
$FN="1";
$REDO=0;
$ACTION;
$SESSION;
$ENTER_NAME;
$ENTER_VALUE;
$strings="";
$_ctr_strings=0;
#my $mywsg=new WSG;
$req = new HTTP::Request 'GET' => 'http://194.16.207.17:5061/WSG';   #### sito demo
#print $req;
#************** MAIN *********************
# &ReadParse;    ### for the  CGI version

#$| = 1;		### for the  CGI  version
#$CITTA = $in{citta}; 	### for the  CGI  version
#$CAMERA = $in{camera};	### for the  CGI  version
#$DA = $in{da};		### for the  CGI  version
#$A = $in{a};		### for the  CGI  version
print "Content Type: text/html\n\n";	### for the  CGI  version
print "<html> <body bgcolor=#ffffff> <pre>\n"; ### for the  CGI  version
print "> getting login page ...........\n";
$login_page=GetLoginForm($req);

#$login_page="1.login";   # this is for doing a test on a saved page instead
#  print $login_page; # debug
print "> parsing login page ............\n";
ParseDefaultForm(\$login_page);  # pass the reference if u wanna parse the page just retrieved

# ParseDefaultForm($login_page);  # like this if you wanna parse a saved page instead 
print "> submitting login page  & getting Query1 form.........\n";
$s=SubmitLogin();
# print $s;  # debug

print "> parsing Query1 form.........\n";
ParseDefaultForm(\$s);

if ($REDO) { DoRedo}; 	# not tested: redo in case you get spurious messages
			# like 'queue allocated to another job' etc. 
			# you should be able
			# to eliminate thos message with some configuration on the AS side


print "> submitting query 1  & getting Query2 form .........\n";
## will choose '1' from the firt form
$q2=SubmitQuery1();
# print $q2; # debug

print "> parsing Query2 form.........\n";
ParseDefaultForm(\$q2);
if ($REDO) { DoRedo};  
$strings=(@_);

print "> submitting query 2 & getting Query3 form.........\n";
##  will choose  '2' in the second form

$q3=SubmitQuery2();
# print $q3;  # debug

print "> parsing Query3 form.........\n";
ParseFinalForm(\$q3);
if ($REDO) { DoRedo};  
#$strings=(@_);


print "START\n";
print $#strings;
#$x=<stdin>;
for($a=0; $a<$_ctr_strings; $a++)
	{
		print  $strings[$a],"\n";
		}



print "END</pre>";
exit;
#************ END MAIN *******************

sub ParseDefaultForm
{
	$p = HTML::TokeParser->new(shift||\$_);

	while (my $tk = $p->get_tag()) 
		{
		ParseActionAndSessionAndEnter($tk);
		}	
	undef ($p);
	
}
sub ParseFinalForm
{
	$p = HTML::TokeParser->new(shift||\$_);
	$_ctr_strings=0;
	while (my $token = $p->get_tag()) 
		{
		ParseStrings($token)
		}	
	undef ($p);
}

sub DoRedo
## untested
	{
	print "doing REDOOOO:\n";
	$q2=SubmitEnter();
print "---DUMP q2-----\n";
print "-----------------\n";
	print $q2;
	ParseDefaultForm(\$q2);
	}

sub GetLoginForm
	{
	my $ua = new LWP::UserAgent;
#    local ($url) = @_;
	 $r=$ua->request(@_);
	return $r->as_string();
	}


sub SubmitLogin
	{
	my $ua = new LWP::UserAgent;
 	$r=$ua->request(POST $ACTION,
	['SESSION' => $SESSION,
	'-General-' => '-NONE-',
	$ENTER_NAME => $ENTER_VALUE,
	'AFIELD.006-053' =>'demo',
	'AFIELD.007-053'  => 'demo']);
	return $r->as_string();
	}
sub SubmitEnter
	{
	my $ua = new LWP::UserAgent;
 	$r=$ua->request(POST $ACTION,
	['SESSION' => $SESSION,
	'-General-' => '-NONE-',
	$ENTER_NAME=> $ENTER_VALUE]);
	return $r->as_string();
	}
sub SubmitQuery1
	{
	my $ua = new LWP::UserAgent;
	my $r=$ua->request(POST  $ACTION,
	['SESSION' => $SESSION,
	'-General-' => '-NONE-',
	$ENTER_NAME => $ENTER_VALUE,
	'AFIELD.020-007' =>'1']);


# 	my $r=$ua->request(POST  $ACTION,
#	['SESSION' => $SESSION,
##-General-' => '-NONE-',
#	$ENTER_NAME => $ENTER_VALUE,
#	'AFIELD.018-015' =>'04']);
	return $r->as_string();
	}

sub SubmitQuery2
	{
    my $q1 = @_;
	my $ua = new LWP::UserAgent;
 	my $r=$ua->request(POST  $ACTION,
	['SESSION' => $SESSION,
	'-General-' => '-NONE-',
	'AFIELD.021-007' => '2',
	$ENTER_NAME => $ENTER_VALUE]);
	return $r->as_string();
	}




sub ParseActionAndSessionAndEnter
	{
 local ($token) = @_;
 

	   	if ($token->[0] eq "form")
			{
	     	 	$ACTION = $token->[1]{action} || "-";
	     	 	$res{"ACTION"}= $action;
			}	
		if ($token->[0] eq "input")
			{
			my $name = $token->[1]{name} || "-";
		     my $value = $token->[1]{value} || "-";
		     my $type = $token->[1]{type} || "-";
		     if ( $name eq "SESSION")
				{
#				print "----------------------\n";
				$SESSION=$value;
				}
		if ( $value eq "Enter")
				{
				$ENTER_NAME  = $name;
				$ENTER_VALUE = $value;
				}
		}
#	return %res;	
	}

sub ParseStrings
### the final parsing step: the real job
	{
 	local ($token) = @_;
		if ($token->[0] eq "font") # in case wanted strings are between font tags

			{
			my $str  = $p->get_trimmed_text;
####		        ParseMessageQueue(\$str); # untested
			$strings[$_ctr_strings]=$str;
			$_ctr_strings=$_ctr_strings+1;
			}
		else	##  also parse  anything outside font tags couples
			{
			my $str2  = $p->get_text("font"); 	# get any string outside font tags
							# and before the next font tag
###		        ParseMessageQueue(\$str2); # untested 
			$strings[$_ctr_strings]=$str2;
			$_ctr_strings=$_ctr_strings+1;
			}
	}


sub ParseMessageQueue
####  untested:
####  will search for  the'alocated to another job' phrase
####  you can anyway eliminate these spurious message system side (dunno how)

	{
		$s=@_;
#
			$pattern="is allocated to another job";
			# $pattern="was not understood";

			if  (/$pattern/)
				{
#				press
				$REDO=1;
				print "REDOOOOOO!\n";
				}
	}
# ***********END OF wsggw************




######### needed for the CGI version
#####################################
# Perl Routines to Manipulate CGI input
# S.E.Brenner@bioc.cam.ac.uk
# $Header: /cys/people/seb1005/http/cgi-bin/RCS/cgi-lib.pl,v 1.7 1994/11/04 00:
#17:17 seb1005 Exp $
#
# Copyright 1994 Steven E. Brenner
# Unpublished work.
# Permission granted to use and modify this library so long as the
# copyright above is maintained, modifications are documented, and
# credit is given for any use of the library.
#
# Thanks are due to many people for reporting bugs and suggestions
# especially Meng Weng Wong, Maki Watanabe, Bo Frese Rasmussen,
# Andrew Dalke, Mark-Jason Dominus and Dave Dittrich.

# see http://www.seas.upenn.edu/~mengwong/forms/   or
#     http://www.bio.cam.ac.uk/web/                for more information

# Minimalist http form and script (http://www.bio.cam.ac.uk/web/minimal.cgi):
# if (&MethGet) {
#   print &PrintHeader,
#       '<form method=POST><input type="submit">Data: <input name="myfield">';
# } else {
#   &ReadParse(*input);
#   print &PrintHeader, &PrintVariables(%input);
# }


# MethGet
# Return true if this cgi call was using the GET request, false otherwise
# Now that cgi scripts can be put in the normal file space, it is useful
# to combine both the form and the script in one place with GET used to
# retrieve the form, and POST used to get the result.



sub MethGet {

  return ($ENV{'REQUEST_METHOD'} eq "GET");

}



# ReadParse

# Reads in GET or POST data, converts it to unescaped text, and puts

# one key=value in each member of the list "@in"

# Also creates key/value pairs in %in, using '\0' to separate multiple

# selections



# If a variable-glob parameter (e.g., *cgi_input) is passed to ReadParse,

# information is stored there, rather than in $in, @in, and %in.



sub ReadParse {

    local (*in) = @_ if @_;





  local ($i, $loc, $key, $val);



  # Read in text

  if ($ENV{'REQUEST_METHOD'} eq "GET") {

    $in = $ENV{'QUERY_STRING'};

  } elsif ($ENV{'REQUEST_METHOD'} eq "POST") {

    read(STDIN,$in,$ENV{'CONTENT_LENGTH'});

  }



  @in = split(/&/,$in);



  foreach $i (0 .. $#in) {

    # Convert plus's to spaces

    $in[$i] =~ s/\+/ /g;



    # Split into key and value.

    ($key, $val) = split(/=/,$in[$i],2); # splits on the first =.

	#!! text fields return empty values when user doesn't use; dump these

	($val eq "") && next;



    # Convert %XX from hex numbers to alphanumeric

    $key =~ s/%(..)/pack("c",hex($1))/ge;

    $val =~ s/%(..)/pack("c",hex($1))/ge;



    # Associate key and value

    $in{$key} .= "\0" if (defined($in{$key})); # \0 is the multiple separator

    $in{$key} .= $val;

  }



  return 1; # just for fun

}



# PrintHeader

# Returns the magic line which tells WWW that we're an HTML document



sub PrintHeader {

  return "Content-type: text/html\n\n";

}



# PrintVariables

# Nicely formats variables in an associative array passed as a parameter

# And returns the HTML string.



sub PrintVariables {

  local (%in) = @_;

  local ($old, $out, $output);

  $old = $*;  $* =1;

  $output .=  "<DL COMPACT>";

  foreach $key (sort keys(%in)) {

    foreach (split("\0", $in{$key})) {

      ($out = $_) =~ s/\n/<BR>/g;

      $output .=  "<DT><B>$key</B><DD><I>$out</I><BR>";

    }

  }

  $output .=  "</DL>";

  $* = $old;



  return $output;

}



# PrintVariablesShort

# Nicely formats variables in an associative array passed as a parameter

# Using one line per pair (unless value is multiline)

# And returns the HTML string.





sub PrintVariablesShort {

  local (%in) = @_;

  local ($old, $out, $output);

  $old = $*;  $* =1;

  foreach $key (sort keys(%in)) {

    foreach (split("\0", $in{$key})) {

    foreach (split("\0", $in{$key})) {

      ($out = $_) =~ s/\n/<BR>/g;

      $output .= "<B>$key</B> is <I>$out</I><BR>";

    }

  }

  $* = $old;



  return $output;

}



}



--------------C41F0F522DDE6336BF0BB1B2--




------------------------------

Date: Wed, 17 Feb 1999 10:11:06 -0500
From: "Michael Courter" <mcourter@mindspring.com>
Subject: perl programmer in atlanta
Message-Id: <7aem4f$va8$1@samsara0.mindspring.com>

we are looking for a fulltime perl programmer in atlanta ga to maintain or
web site and help develop version two of same. should be comfortable with nt
4.0, ms sql 6.5, iis 4.0. familiar with mod perl or active server pages a
plus. mid to hi 50s.
michael courter
mcourter@mindspring.com
terryl@mindspring.com
terry lassiter - 770.458.6846




------------------------------

Date: Wed, 17 Feb 1999 10:32:03 -0500
From: "Michael Courter" <mcourter@mindspring.com>
Subject: perl programmer
Message-Id: <7aenbo$4pg$1@samsara0.mindspring.com>

we are looking for a fulltime perl programmer in atlanta ga to maintain
or web site and help develop version two of same. should be
comfortable with NT 4.0, MS SQL 6.5, IIS 4.0. familiar with mod perl
or active server pages a plus. mid to hi 50s.
michael courter
mcourter@mindspring.com
terryl@mindspring.com
terry lassiter - 770.458.6846





------------------------------

Date: Wed, 17 Feb 1999 17:13:41 +0200
From: "Marius Panait" <Marius.Panait@Romania.EU.net>
Subject: perl+DB error
Message-Id: <7aemm7$3no$1@news.Romania.EU.net>

I have install perl 5.00502 and DB_File-1.63 on Sun Solaris 2.6.
The following error occured when tried to execute one perl script:

ld.so.1: /usr/local/bin/perl: fatal: relocation error: file
/usr/local/lib/perl5/5.00502/sun4-solaris/auto/DB_File/DB_File.so: symbol
db_version: referenced symbol not found
Killed


Can someone help me?

Thanks in advance,
Marius




------------------------------

Date: Wed, 17 Feb 1999 13:58:53 GMT
From: ah950@torfree.net (Allen Septon)
Subject: perl/tk for win95
Message-Id: <F7AxI5.Ky3.0.queen@torfree.net>

Hi,

Where can I download PERL/TK in a compiled version for WIN95.
Please respond via email.

Thanks
Allen

-- 
Allen Septon
Toronto Freenet
ah950


------------------------------

Date: Wed, 17 Feb 1999 08:28:12 -0500
From: Tom McGlynn <tam@silk.gsfc.nasa.gov>
Subject: Re: PFR: UTC_to_Epoch
Message-Id: <36CAC3EC.6F27C368@silk.gsfc.nasa.gov>

Larry Rosler wrote:
> 
> [Posted and a courtesy copy mailed.]
> 
> In article <36C9C604.96D44FCB@silk.gsfc.nasa.gov> on Tue, 16 Feb 1999
> 14:24:52 -0500, Tom McGlynn <tam@silk.gsfc.nasa.gov> says...
> > Shouldn't this code at least mention that it
> > does not address leap-seconds?
> 
> The Unix-epoch time scale does not address leap-seconds.  gmtime() and
> localtime() do not address leap seconds, but their documentation doesn't
> bother to say so.
> 
> --

That's part of the reason I'd like to see this
documented.  The fact that the other documentation is
incorrect doesn't mean we should propogate the error.
This kind of routine is particularly useful for doing date interval
arithmetic and unless the user is warned this routine could
easily be used to incorrectly calculate the interval
between two dates -- and yes I do have applications where
the leap seconds matter.  Note that I am not saying the
routine should handle leap seconds -- that requires some
method of dynamic updating to handle new leap seconds and would
probably make the code inappropriate for the envisaged library.
But a line in the documentation warning the user of this limitation
could prevent users from abusing this routine in applications where
seconds matter.

	Regards,
	Tom McGlynn
	tam@silk.gsfc.nasa.gov


------------------------------

Date: 16 Feb 1999 22:17:16 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: PFR: UTC_to_Epoch
Message-Id: <7acqpc$193$1@pegasus.csx.cam.ac.uk>

Tom McGlynn  <tam@silk.gsfc.nasa.gov> wrote:
>Shouldn't this code at least mention that it
>does not address leap-seconds?
>
>	Tom McGlynn
>	tam@silk.gsfc.nasa.gov

No.   Because epoch times do not need to address leap seconds.


Mike Guy


------------------------------

Date: 16 Feb 1999 17:57:45 -0500
From: Uri Guttman <uri@ibnets.com>
Subject: regex poll
Message-Id: <39soc6ufbq.fsf@ibnets.com>


as ilya and i are having another war over MRE and versions of perl, i am
posting this poll. i want to know what regex features people use and how
often. i have listed all features i found in the desktop reference which
covers 5.005. if you see some that i have missed, add them. this is both
for s/// and m//.

this is for all levels of perl users. it is useful to know what both
newbies and gurus are using.

i want to see how many features are used and how often. i feel most
regexes use a core subset much more often than the more obscure features
(the 80/20 rule, 80% of regexes use only 20% of the features). this
subset (and more) is covered well by MRE and that is why i keep saying
it is useful regardless it being out of date regarding perl > 5.002. IMO
most of the regex features (by amount of usage) will be covered there.

answers: never almost-never rarely sometimes most-times often almost-always

dot .:					often
alternation |:				sometimes
grouping ():				almost-always
non-grabbing group (?:):		sometimes
back ref \1\2:				never
group vars $1$2:			often
special vars $`$&$':			never
char class []:				almost-always
class abbrev \d\D\s\S\w\W:		almost-always
quantifiers ?+*{}:			almost-always
non-greedy ?:				often
anchors ^$\A\Z\z:			almost-always
look ahead/behind pos/neg (?=!<<!):	almost-never
embedded modifier (?misx):		never
embedded comments (?#):			never
/x comments #:				sometimes
/m modifier:				sometimes
/s modifier:				sometimes
/i modifier:				sometimes
/x modifier:				sometimes
/o modifier:				rarely
/g modifier:				sometimes
/c modifier:				never
/e modifier:				rarely
/ee modifier:				rarely
pos function:				rarely
alternate delimiters:			sometimes
embedded code (?{}):			never
conditional pattern (?()true|false):	never
anchored pattern (?>):			never
regex object qr//:			never
re pragmas:				never


as a bonus what version(s) of perl do you use?

thanx,

uri

-- 
Uri Guttman                             Hacking Perl for Ironbridge Networks
uri@sysarch.com				uri@ironbridgenetworks.com	


------------------------------

Date: Wed, 17 Feb 1999 08:43:43 -0600
From: John Warner <jwarner@tivoli.com>
Subject: Re: Regular expression for Currency ???
Message-Id: <36CAD59F.203B9C2E@tivoli.com>

Hmmm....I'll have to test that out later today.  I thought I was testing for each of those
strings but then again I manage to learn something new about regexes every day.

--

John Warner                       Tivoli Systems Inc.
Sales Support Engineer       9442 Capital Of Texas Hwy North
Sales Infrastructure Group   Austin, TX 78759
john_warner@tivoli.com

Philip Newton wrote:

> John Warner wrote:
> >
> > @nums=m<\-?\$\d{1,3}(?:\,?\d{3})*(?:\.?\d{0,2}?)?(?!\d)\s*[million|thousand|m|k]*>gi;
>                                                             ^^^^^^^^^^^^^^^^^^^^^^^
>
> ITYM (million|thousand|m|k)* or (?:million|thousand|m|k)
> not [million|thousand|m|k]*
>
> (If I'm not mistaken, the thing you wrote is the same as [milonthusadk|]
> -- a character class matching 0 or more of any of the inside, even
> "thousillion" etc.)
>
> Cheers,
> Philip






------------------------------

Date: 17 Feb 1999 09:04:15 -0500
From: clay@panix.com (Clay Irving)
Subject: Re: Speed Up Perl
Message-Id: <7aei8v$i32$1@panix.com>

In <36caa3c2.10005684@news.wxs.nl> pvdkamer@inter.NL.net writes:

>Does anyone have a sulution to speed up perl scripts ?
>i've got several perl scripts wich are all comparing substrings in 2
>textfiles.
>Perl running on Linux is better performing  and Perl running on Win32
>(win98) is not performing at all.

>Does anyone have a solution to speed up perl script mayby by compiling
>them or something else ?

How do you expect anyone to tell you how to speed up your program
without posting the program? The usual answer in this case is improve
line 17... 

-- 
Clay Irving
clay@panix.com


------------------------------

Date: 17 Feb 1999 14:41:30 GMT
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Speed Up Perl
Message-Id: <slrn7clldl.3rp.fl_aggie@enso.coaps.fsu.edu>

On 17 Feb 1999 09:04:15 -0500, Clay Irving <clay@panix.com> wrote:

+ How do you expect anyone to tell you how to speed up your program
+ without posting the program? The usual answer in this case is improve
+ line 17... 

No, you fool! Its line 21!

James - this thread has "long day" written all over it...


------------------------------

Date: 17 Feb 1999 09:01:55 -0500
From: clay@panix.com (Clay Irving)
Subject: Re: STDERR of system call in variable?
Message-Id: <7aei4j$hun$1@panix.com>

In <36CA8E88.A05FADAF@hl.siemens.de> Stefan Etschberger <ste@hl.siemens.de> writes:

>I've got a system call of a UNIX program in a perl script. How do i
>redirect the STDERR output of this program to a perl variable?

Someone asked this question yesterday -- Look in the FAQ, or use 
DejaNews to search for `STDERR' in this newsgroup.

-- 
Clay Irving
clay@panix.com


------------------------------

Date: Wed, 17 Feb 1999 09:01:35 -0500
From: kaulad <ww73@columbia.edu>
Subject: using perl
Message-Id: <36CACBBF.91CC2FB3@columbia.edu>

Hi,
    My friends and I have to do the project by creating web page wand
allowing the users to search our database and automatically update it if
it's possible.  The database itself is not very large since this is a
small project.  I know a little bit of perl and I think I can read and
do something about it.  However, I don't know what to do with the
back-end database. Our TA recommended using MYSQL.  I got the linux box
and windows95 that can be used as the server.  Do any of you have any
suggestion about it?

Thanks a lot.
WUt



------------------------------

Date: Wed, 17 Feb 1999 08:31:08 -0600
From: John Warner <jwarner@tivoli.com>
Subject: Re: y2k problems with perl
Message-Id: <36CAD2AC.45A89387@tivoli.com>

It's not a bug.  Perl was designed that way.  To get the correct year, this
century or next, add 1900 to the year returned by localtime.

--

John Warner    Tivoli Systems Inc.
Sales Support Engineer  9442 Capital Of Texas Hwy North
Sales Infrastructure Group Austin, TX 78759
john_warner@tivoli.com


Ravindran_Abhilash wrote:

> Hi,
>
> Functions gmtime and localtime seems to have problems with year >= 2000.
> For example the time corresponding to year 2000, the year is returned as
> 100 instead of 00.
>
> Does anybody have more information on this?
>
> Thanks,
>
> Abhi






------------------------------

Date: Wed, 17 Feb 1999 09:30:36 -0600
From: James Ludlow <ludlow@us.ibm.com>
Subject: Re: y2k problems with perl
Message-Id: <36CAE09C.51DF47E5@us.ibm.com>

I R A Aggie wrote:
> 
> On Tue, 16 Feb 1999 23:00:12 GMT, Scratchie <upsetter@ziplink.net> wrote:
> 
> + check DejaNews for the last 2,000 times it's been discussed in this
>                               ^^^^^
> Is that what they mean by the Y2K problem??

I'm not sure if it is or not.  I mean, my subject-line counting script
reports that we've only discussed it 100 times.  I'm so confused.

-- 
James Ludlow (ludlow@us.ibm.com)
(Any opinions expressed are my own, not necessarily those of IBM)


------------------------------

Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

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.misc (and this Digest), send your
article to perl-users@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.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

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 V8 Issue 4914
**************************************

home help back first fref pref prev next nref lref last post