[11033] in Perl-Users-Digest
Perl-Users Digest, Issue: 4633 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jan 12 19:02:38 1999
Date: Tue, 12 Jan 99 16:00:24 -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 Tue, 12 Jan 1999 Volume: 8 Number: 4633
Today's topics:
Re: "Email this page to a friend" script (jim barchuk)
Re: @INC - Path on Win32 <due@murray.fordham.edu>
Re: A really easy string question <aqumsieh@matrox.com>
ANNOUNCE: DbFramework-1.06 <paul@miraclefish.com>
Re: cut (Tad McClellan)
Re: excel file handling (Jan Dubois)
Re: global search and replace in files <cdkaiser@delete.these.four.words.concentric.net>
Re: Graphical SNMP Monitor (Tk)? (Cameron Laird)
Re: grep with boundaries and regex <aqumsieh@matrox.com>
help <gala@sonic.net>
Re: How to stop perldoc scroll on find? <due@murray.fordham.edu>
Re: How to stop perldoc scroll on find? <due@murray.fordham.edu>
Ignoring Comments while Parsing C/C++ Header Files <gibsonc@aztec.asu.edu>
Re: Low level perl (Martien Verbruggen)
Merging multiple files together........ <darrick@2unreal.com>
Re: Merging multiple files together........ <kprice@cardinal.co.nz>
NEED SCRIPT BAD!!!!!! (buddy gripple)
Perl and Solaris -- socket.ph problems! tshureih@standard.com
Re: Perl Criticism (I R A Aggie)
Re: Perl Criticism (David Formosa (aka ? the Platypus))
Re: Perl Criticism <david@kasey.umkc.edu>
Perl on Solaris 2.6 breaking (ftp.pl) tariqx@my-dejanews.com
Re: prog1 lookalike in Perl? <uri@ibnets.com>
Re: Randal's code [was Re: How do I delete tmp files ba <david@kasey.umkc.edu>
Re: Randal's code [was Re: How do I delete tmp files ba (Randal L. Schwartz)
Read file problem (John )
Re: Read file problem (Sam Holden)
Re: regulart expression <aqumsieh@matrox.com>
Re: Verify an email address (Bart Lateur)
Re: Verify an email address (I R A Aggie)
Re: Verify an email address (Randal L. Schwartz)
Re: Were to learn PERL Online. (Tad McClellan)
where is the lexical parser ? (Yao Xu)
Re: where is the lexical parser ? (Ilya Zakharevich)
white paper on how Perl interpreter works or designed ? (Yao Xu)
Win32::ODBC, Perl SQL vs. standard SQL (Douglas Leonard)
Re: Year 2038 problem <bvitro@cisco.com>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 12 Jan 1999 16:55:00 -0500
From: jb@jbarchuk.com (jim barchuk)
Subject: Re: "Email this page to a friend" script
Message-Id: <kbgg77.1b7.ln@jbarchuk.tiac.net>
Hello Piers!
>> >:: 1) be viewing a specific html file
>> >:: 2) click on a link that says "email this page to a friend"
>> >:: 3) enter their address, the friend's, and possibly a message
>> >:: 4) have the page be sent to the specified person, with a static
>> >:: message added to the end of the email
> Unless you're after capturing a whole bunch of email addresses. But I
> can't think why you'd want to do such a thing.
How about for sending a page to someone who has only email access?
In any case the above is insane overkill for mere address harvesting,
and doesn't sound like the intent.
Have a :) day!
jb
--
jim barchuk
jb@jbarchuk.com
------------------------------
Date: 12 Jan 1999 23:54:28 GMT
From: "Allan M. Due" <due@murray.fordham.edu>
Subject: Re: @INC - Path on Win32
Message-Id: <77gnbk$gq6$0@206.165.146.28>
Jvrg Dolle wrote in message
<0E16861EE7BCD111BE9400805FE6841F0629A288@c1s5x001.cor.srvfarm.origin-it.com>.
..
|Who can help me with this entry?
|
|C:\>perl -e "print (@INC)"
|C:\PERL\5.005\lib/MSWin32-x86-objectC:\PERL\5.005\libC:\PERL\site\5.005\lib/
|MSWi
|n32-x86-objectC:\PERL\site\5.005\libC:\PERL\site\lib.
|
|How could I change "/" to "\" in the @INC variable?
Ok, I'll bite. Why to you want to change the inclinations of those slashes?
Neither perl nor Windoze cares which way they lean.
AmD
------------------------------
Date: Tue, 12 Jan 1999 12:46:16 -0500
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: A really easy string question
Message-Id: <x3ybtk45qqf.fsf@tigre.matrox.com>
info@gadnet.com writes:
>
> I'm new to this perl lark and struggling to do the following:
>
> I have a variable ($variable) which contains:
>
> $pathname = "/path-of-indeterminate-length/myfile.txt";
>
> I want to end up with a variable that contains:
>
> myfile.txt
Read perlre ...
($filename) = $pathname =~ /^.*\/(.*)$/;
------------------------------
Date: Tue, 12 Jan 1999 22:40:51 +0000
From: Paul Sharpe <paul@miraclefish.com>
Subject: ANNOUNCE: DbFramework-1.06
Message-Id: <369BCF73.DF55A675@miraclefish.com>
file: $CPAN/authors/id/P/PS/PSHARPE/DbFramework-1.06.tar.gz
size: 24187 bytes
md5: b8ab07a6b19e3deb007cca8218694ffc
DbFramework is a collection of classes for manipulating Mysql
databases. The classes are loosely based on the CDIF Data Model
Subject Area.
This module will help you to
- Present data model objects (tables, columns) as HTML
- Add persistency to your Perl objects
- Manipulate your Mysql databases through an HTML forms interface
See the POD for further details.
Prerequisites
=============
Alias
CGI
DBI
Msql-Mysql-modules
ePerl (for dbforms.cgi)
RELEASE 1.06
= UI
Default input templates now produce 'datasheet' view.
= API
Attribute::
- New method as_html_heading()
Key::
- New method as_html_heading()
PrimaryKey::
- New method as_html_heading()
Table::
- New method as_html_heading()
------------------------------
Date: Tue, 12 Jan 1999 16:01:39 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: cut
Message-Id: <3ogg77.9h.ln@magna.metronet.com>
Gump (a14203@cig.mot.com) wrote:
: Is there a function in perl which can do task just like
: "cut" command in Unix?
: for example, get third part ("1.2.0") from below string:
: "KingSoftware StarTest 1.2.0 01-01-1999"
$part3 = (split /\s+/)[2];
: Please reply to my email.
That is rather selfish.
If I do that then you get your answer, but none of the other
of thousands of people here get to see it.
This is a community where we like to help each other (hopefully
a whole bunch of folks at a time).
Ask it here, get the answer here.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 12 Jan 1999 23:47:31 +0100
From: jan.dubois@ibm.net (Jan Dubois)
Subject: Re: excel file handling
Message-Id: <36a6ce83.13781646@news3.ibm.net>
[mailed & posted]
walker <walkerspace@yahoo.com> wrote:
>Anyone can point me to some places for ActiveState Perl + Excel on
>Window NT, like example codes? Would appreciate it very much. I borrowed
>a simple test file from http://www.mkaz.com/web/perl/xl_oleauto.html,
>but just cann't make it work, such as:
I think the sample code from my Win32::OLE article in The Perl Journal #10
is somewhere on the TPJ web site (http://www.tpj.com), but I don't know
how useful it is without the text.
>use Win32::OLE
> $xl_app = CreateObject OLE 'Excel.Application' || die $!;
>............(little others)
You are mixing "old style" OLE with "new style" Win32::OLE. Try:
my $xl = Win32::OLE->new('Excel.Application') or die;
>Error says: cann't locate object method "CreateObject" via package
>"OLE" at test.txt line 2. I use ActiveState Perl on Window NT. Being a
>beginner, details are the best. Thanks ahead.
Does "ActiveState Perl" mean ActivePerl build 50x or Perl for Win32 build
3xx? Please use the latest 5xx builds (ActivePerl) for OLE stuff. It also
contains all the documentation of the Win32::OLE::* modules.
I would also suggest to ask for help with ActivePerl and Win32::OLE on the
Perl-Win32-Users mailing list at ActiveState.com. You'll have a higher
chance of getting answers there.
I don't have any small standalone Excel samples, but here is a snippet I
used to help someone else:
#########################################################################
use strict;
use Win32::OLE qw(with);
use Win32::OLE::Const 'Microsoft Excel';
my $Excel = Win32::OLE->new("Excel.Application");
$Excel->{Visible} = 1;
my $Book = $Excel->Workbooks->Add;
my $Sheet = $Book->Worksheets(1);
my $Range = $Sheet->Range("A2:C7");
$Range->{Value} =
[['Arrived at Port', 'Parked in Staging', 'Loaded Onto Ship'],
[807, 104, 0],
[1218, 210, 0],
[1635, 371, 0],
[1784, 561, 0],
[1884, 706, 0]];
my $Chart = $Excel->Charts->Add;
$Chart->{ChartType} = xlAreaStacked;
$Chart->SetSourceData({Source => $Range, PlotBy => xlColumns});
$Chart->{HasTitle} = 1;
$Chart->ChartTitle->{Text} = "Closure Profile Graph (Number of Pieces)";
#########################################################################
-Jan
------------------------------
Date: 12 Jan 1999 14:08:43 PST
From: Cameron Kaiser <cdkaiser@delete.these.four.words.concentric.net>
Subject: Re: global search and replace in files
Message-Id: <77gh5b$opq@chronicle.concentric.net>
Cameron Kaiser <cdkaiser@delete.these.four.words.concentric.net> writes:
>Provide the filename on the command line, and the output is in filename.bak.
Er, the original is in filename.bak, and the actual output is in filename.
--
Cameron Kaiser * cdkaiser.cris@com * powered by eight bits * operating on faith
-- supporting the Commodore 64/128: http://www.armory.com/~spectre/cwi/ --
head moderator comp.binaries.cbm * cbm special forces unit $ea31 (tincsf)
personal page http://calvin.ptloma.edu/~spectre/ * "when in doubt, take a pawn"
------------------------------
Date: 12 Jan 1999 16:36:47 -0600
From: claird@Starbase.NeoSoft.COM (Cameron Laird)
Subject: Re: Graphical SNMP Monitor (Tk)?
Message-Id: <77gipv$sta$1@Starbase.NeoSoft.COM>
In article <77g1f7$udk$1@nnrp2.dejanews.com>, <otis@my-dejanews.com> wrote:
>Hello,
>
>I was wondering if there are any utilities that will monitor SNMP and display
>the results graphically?
>
>I'm aware of MRTG and SNMP::Monitor, but they both use a browser. I was
>wondering if there is something that uses Tk to display traffic, nodes, etc.
.
.
.
A fascinating package called Scotty <URL:http://
starbase.neosoft.com/~claird/comp.lang.tcl/scotty.html>
does exactly this. It's based on Tcl/Tk, though, not
PerlTk. Of course, it's easy to glue together Tcl and
Perl applications.
--
Cameron Laird http://starbase.neosoft.com/~claird/home.html
claird@NeoSoft.com +1 281 996 8546 FAX
------------------------------
Date: Tue, 12 Jan 1999 12:43:59 -0500
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: grep with boundaries and regex
Message-Id: <x3yd84k5qu9.fsf@tigre.matrox.com>
pigs_can_fly@mindless.com (Jason Q.) writes:
>
> > @temp = grep( $_ eq $word, @temp);
>
> Does this allow me to grep whole words only AND recognise "=" at the
> same time? I tried it out but it failed to grep anything at all.
This should work. You're doing something wrong somewhere else then.
> The line itself is in a foreach loop, and I believe $_ is already
> being used.
That shouldn't be a problem since grep localizes $_. But to be safe,
don't use $_ if you can. It can be tricky sometimes.
> I just started learning Perl and have reservations posting my
> primitive perl lines in this newsgroup (which can be quite
> unforgiving). But that's the only way I'd learn, so here goes....
No problem with asking questions per se. But please do some research
before posting. You might save yourself the hassle.
> What I'm trying to do is
> 1. grep multiple keywords from several databases.
> 2. grep only whole words, which might include "=" (equal signs)
>
> -----------------------------------------------------------------------
>
> foreach (@database)
> {
> open(DATABASE, $_);
check the result of your open().
open DATABASE, $_ or die "Can't open '$_': $!\n";
> @temp = <DATABASE>;
> close(DATABASE);
close DATABASE or die "Can't close '$_': $!\n";
> foreach $word (@keywords)
> {
> @temp = grep(/$word/,@temp);
> }
Here, you are over-writing your @temp variable in each loop. That is
probably why you're not getting your results. Use another variable.
@temp2 = grep /$word/, @temp;
If the string you want to match is *exactly* equal to $word, then you
might want to do either:
@temp2 = grep /^$word$/, @temp;
or
@temp2 = grep { $_ eq $word } @temp;
If you use the first one, I suggest you look into using \Q and \E.
> push @confirm, @temp;
update this accordingly:
push @confirm, @temp2;
> }
>
> -----------------------------------------------------------------------
>
> Tell me where I'm going wrong, or better still, tell me how I can
> better it.
The above modifications should work. You should also check my reply to
your earlier (somewhat similar) post.
Hope this helps,
Ala
------------------------------
Date: Tue, 12 Jan 1999 14:48:12 -0800
From: "Gala Grant" <gala@sonic.net>
Subject: help
Message-Id: <77gjdj$jn1$1@ultra.sonic.net>
I know that this isn't the place to post CGI questions, but I don't know
where that place is. Can anyone help me?
Gala Grant
gala@sonic.net
------------------------------
Date: 12 Jan 1999 23:16:07 GMT
From: "Allan M. Due" <due@murray.fordham.edu>
Subject: Re: How to stop perldoc scroll on find?
Message-Id: <77gl3n$cfq$0@206.165.146.28>
Ala Qumsieh wrote in message ...
|"Charles R. Thompson" <design@raincloud-studios.com> writes:
|> I've noticed when say doing...
|> perldoc -f stat
|> Some of the text rolls off the screen. Of course I could just go
|> perldoc stat
|> But I rather like the quick summaries given by -f. Is there
|> another switch to make it pause the output 1 screen at a time?
|> perldoc perldoc didn't mention anything about it.
|
|Of course, since that's not a Perl issue. I have two suggestions:
|
|1) perldoc -f stat > stat_help
Does that work on your system? It doesn't on mine. For me it creates an
empty file stat_help. Since long ago, the output from batch files doesn't
redirect well. Stupid DOS.
|Then you can browse stat_help anyway you like.
|
|2) perldoc -f stat | more
Does that work on you system? Because it doesn't on mine. Same problem.
What happened when you tested these? Your DOS system must be different from
mine.
Mine being:
Windows 95. [Version 4.00.950]
This is perl, version 5.005_02 built for MSWin32-x86-object
The only way I have managed to get perldoc to more is to change the
perldoc.bat file editing the 4rd line to read:
perl -x -S "%0" %1 %2 %3 %4 %5 %6 %7 %8 %9 | more
of course it must be so that TIMTOWTDI.
I saved the new batch file as myperldoc.bat and left it in the same directory
so I have a more and a non-more version available.
HTH
AmD
------------------------------
Date: 12 Jan 1999 23:32:04 GMT
From: "Allan M. Due" <due@murray.fordham.edu>
Subject: Re: How to stop perldoc scroll on find?
Message-Id: <77gm1k$ec8$0@206.165.146.28>
Ok, my post was just way too snippy (and predicated on a stupid assumption).
Frankly, I just assumed that this was a DOS only issue, UNIX being too vastly
superior to Winhoze for it to have a similar problem. Well I guess that UNIX
does have the same problem but using | more solves it under UNIX, in Windoze
it does not. I forgot that UNIX too can pipe to more, if I had remembered
this fact a wee bit earlier I would have worded my message differently.
Sorry. I hope the solution at least can help some other poor POB.
Allan M. Due wrote in message <77gl3n$cfq$0@206.165.146.28>...
|Ala Qumsieh wrote in message ...
||"Charles R. Thompson" <design@raincloud-studios.com> writes:
||> I've noticed when say doing...
||> perldoc -f stat
||> Some of the text rolls off the screen. Of course I could just go
||> perldoc stat
||> But I rather like the quick summaries given by -f. Is there
||> another switch to make it pause the output 1 screen at a time?
||> perldoc perldoc didn't mention anything about it.
||
||Of course, since that's not a Perl issue. I have two suggestions:
||
||1) perldoc -f stat > stat_help
|
|Does that work on your system? It doesn't on mine. For me it creates an
|empty file stat_help. Since long ago, the output from batch files doesn't
|redirect well. Stupid DOS.
|
||Then you can browse stat_help anyway you like.
||
||2) perldoc -f stat | more
|
|
|Does that work on you system? Because it doesn't on mine. Same problem.
|What happened when you tested these? Your DOS system must be different from
|mine.
|
|Mine being:
|Windows 95. [Version 4.00.950]
|This is perl, version 5.005_02 built for MSWin32-x86-object
|
|The only way I have managed to get perldoc to more is to change the
|perldoc.bat file editing the 4rd line to read:
|
|perl -x -S "%0" %1 %2 %3 %4 %5 %6 %7 %8 %9 | more
|
|of course it must be so that TIMTOWTDI.
|
|I saved the new batch file as myperldoc.bat and left it in the same directory
|so I have a more and a non-more version available.
||
------------------------------
Date: Tue, 12 Jan 1999 15:59:15 -0700
From: "gip" <gibsonc@aztec.asu.edu>
Subject: Ignoring Comments while Parsing C/C++ Header Files
Message-Id: <77gjqn$pen@bmw.hwcae.az.Honeywell.COM>
Does someone have an example of parsing a C/C++ header file where C and C++
style comments are ignored?
Thanks for your time.
Please email me at gip_123@yahoo.com
------------------------------
Date: Tue, 12 Jan 1999 22:28:48 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Low level perl
Message-Id: <A0Qm2.52$6e.2714@nsw.nnrp.telstra.net>
In article <369B281E.AC6A2C1C@dam.dunaferr.hu>,
Viczai Gabor <gviczai@dam.dunaferr.hu> writes:
> Have a nice perl to everyone,
>
> When I first heard about Perl it was told to be hacker's favourite
> language. Now can anyone tell me how to create an Ethernet packet
> and send it over a LAN or how can I capture Ethernet packets
> transmitted on wire and take a look of it?
Most of the functionality bundled with perl to deal with network
packets are based on TCP/IP implementations being installed, and
properly configured. The perl stuff calls this TCP/IP layer.
To create raw ethernet packets you'll have to talk to your ethernet
driver directly. I have never tried anything like that in perl, or in
any other language in the last 10 years, but it's not a trivial thing,
and it's highly unportable. TCP/IP is a standard. Ethernet packets are
standardised. Ethernet interfaces aren't really, although there is
some level of commonality, and some abstraction levels.
> The main task is to inspect one's ethernet adress only with knowing his
> IP address.
Wait.. Didn't you say you wanted to create ethernet packets? At that
level there is no such thing as an IP address. Did you really mean
that you wanted to create TCP/IP packets, or inspect TCP/IP packets?
or do you really want all ethernet packets?
Most unices will have something called 'snoop' installed to get
packets from the network. I don't know what other OS's have to offer
in that regard. I would certainly not be inclined to roll my own stuff
:)
Once you have those packets, all you need to do is parse them. Read
the relevant RFCs for their format. You might even be able to use one
of the Net:: modules for it.
To send TCP/IP packets I'd recommend using one of the modules on CPAN.
Net::TCP and Net::UDP come to mind. If you can use one of the
established protocols, use the more specific module.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | Make it idiot proof and someone will
Commercial Dynamics Pty. Ltd. | make a better idiot.
NSW, Australia |
------------------------------
Date: Tue, 12 Jan 1999 13:57:35 -0800
From: Dee <darrick@2unreal.com>
Subject: Merging multiple files together........
Message-Id: <369BC54F.D1A7C46C@2unreal.com>
Hello,
I have a situation were I have many text files that contain
information in the following format:
date time firstname lastname address city state zip
I would like to create a perl script (because I was informed that it
would be the best scripting language for this task) that would open up
multiple text files and merger all of the data contained within these
files into one file. I would like for the finished data to be arranged
by date then time then finally by lastname.
I never created a program in my life and I would just like to know
how difficult this would be to accomplish. If someone has code that will
accomplish my goal then I would much appreciate it.
Thank you,
DEE
The begginer.
------------------------------
Date: Wed, 13 Jan 1999 11:10:38 +1300
From: Kelvin Price <kprice@cardinal.co.nz>
Subject: Re: Merging multiple files together........
Message-Id: <369BC85E.5FA4B226@cardinal.co.nz>
Dee wrote:
>
> Hello,
> I have a situation were I have many text files that contain
> information in the following format:
> date time firstname lastname address city state zip
> I would like to create a perl script (because I was informed that it
> would be the best scripting language for this task) that would open up
> multiple text files and merger all of the data contained within these
> files into one file. I would like for the finished data to be arranged
> by date then time then finally by lastname.
>
Unix or NT ??
If you're in a Unix environment then you wouldn't need perl to do what
you want. Just use the provided sort utility and redirect the output to
a file.
If you want to use perl, you would have to read all the files into 1
large list, sort the list, write the list to a file. The supplied doco
is more than good enough to accomplish this.
------------------------------
Date: Tue, 12 Jan 1999 23:24:57 GMT
From: mineral@flash.net (buddy gripple)
Subject: NEED SCRIPT BAD!!!!!!
Message-Id: <369cd930.31856682@news.flash.net>
hi,
i was wondering if anyone knows if there is a script somewhere that
will take input entered by a user into a form text field and turn it
into a .txt document with a filename that i can choose. i also need
that .txt to AUTOMATICALLY OVERWRITE the current one if it exists.
does that make any sense? is there any way to do that? can ANYONE help
me pleeeeeeaaaassssseeeee...
-bg
------------------------------
Date: Tue, 12 Jan 1999 23:37:57 GMT
From: tshureih@standard.com
Subject: Perl and Solaris -- socket.ph problems!
Message-Id: <77gmck$bp2$1@nnrp1.dejanews.com>
My script is:
#!/apps/local/bin/perl
require "ftp.pl";
$ftpHost = "<my_host_FQDN>";
if (&ftp::open($ftpHost,21,0,1) !=1) {
die "Can't open $ftpHost\n" ;
}
if (&ftp::login("<my_user_name>","<my_password>") != 1 ) {
die "Can't Login\n";
}
if (($PWD=&ftp::pwd) eq "") {
die "Can't get pwd" ;
}
print "pwd=$PWD" ;
&ftp::close
The error is: Bareword found where operator expected at
/apps/local/lib/perl5/site_perl/5.005/ sun4-solaris/sys/feature_tests.ph line
20, near """invalid" (Missing operator before invalid?) Bareword found where
operator expected at /apps/local/lib/perl5/site_perl/5.005/
sun4-solaris/sys/feature_tests.ph line 20, near "invalid _FILE_OFFSET_BITS"
(Do you need to predeclare invalid?) String found where operator expected at
/apps/local/lib/perl5/site_perl/5.005/su n4-solaris/sys/feature_tests.ph line
20, near "specified""" syntax error at
/apps/local/lib/perl5/site_perl/5.005/sun4-solaris/sys/feature_t ests.ph line
20, near """invalid "
Any idea?
I'm using Perl 5.005_02 on Solaris 2.6 Sun Ultra 1.
Please email tshureih@standard.com
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Tue, 12 Jan 1999 17:44:26 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Perl Criticism
Message-Id: <fl_aggie-1201991744260001@aggie.coaps.fsu.edu>
In article <77gcnl$8dk$1@zarathustra.calstatela.edu>, Graffiti
<ramune@zarathustra.calstatela.edu> wrote:
+ Are you *sure* you want to see the names? I'd bet Xxxxx Xxxxx is one
+ of them. :-)
Tho shalt not use that name here! I know of whom you speak, and he is
buried deeply in my killfile.
James
------------------------------
Date: 12 Jan 1999 23:26:47 GMT
From: dformosa@zeta.org.au (David Formosa (aka ? the Platypus))
Subject: Re: Perl Criticism
Message-Id: <slrn79nmhm.66p.dformosa@godzilla.zeta.org.au>
In article <77g7p5$f1n$1@nnrp2.dejanews.com>, topmind@technologist.com wrote:
>In article <x7n23rk8o3.fsf@home.sysarch.com>,
> Uri Guttman <uri@home.sysarch.com> wrote:
[...]
>"Isolate" has NO EFFECT on parameters and Globals. Perhaps i did
>not state that clearly enough.
>
>"Isolate" simply makes a function not "see" the variables
>created or inherited by the parent. Parameters still go in
>(and back out if so set).
But as they don't inherit the variables created by there perent [1]
there is no need for such a key word.
[...]
[...]
>For example Perl has these stupeeds:
>
> thisdate = `date`;
> dothis || die "error"
>
>Perl put these things in purely for backward familiarity with
>Unix scripting.
And what is wrong with that, comminication is achived threw use of
mulituly understood symbols. If there is a preexisting symbol that
already has that meaning it is prefratable for them to make use of
that rather then creating a whole new symbol.
> The backtics are WAY too easy to confuse with
>string quotes,
I in all my programing experence have never confused the two, in any
decent monospaced font there is a clear and readable diffrence between
the two.
> the the || in this context should be a
>regular "if" statement.
It shoudn't; perl (like english) allows you to express yourself in
mulipal diffrent ways. In perticular it allows you to move the words
in a sentence around so the idear that you are interested in gets the
maximum impact. However in this case it may be better to write this
as,
dothis or die "I was unable to do this";
Looks almost like english doesn't it?
>Why not have a Pipe() or Exec() function instead of backtics?
Perl already has an exec stament with a diffrent meaning.
>What the hell was going throught their mind? I suspect they
>thought it was somehow clever or cute to use goofy symbols
>in goofy contexts.
Some would argue that exec is as much a goofy symbol as '.
[...]
>My Perl coding tends to resemble non-piping languages such as VB.
>I don't use many of its hidden parameters and goofy stuff.
Ok, lets see some of it then.
[1] unless your useing local but no moden perl programmer does that.
--
Please excuse my spelling as I suffer from agraphia. See
http://www.zeta.org.au/~dformosa/Spelling.html to find out more.
How to win arguments on usenet http://www.zeta.org.au/~dformosa/usenet.html
------------------------------
Date: Tue, 12 Jan 1999 17:55:14 -0600
From: David L Nicol <david@kasey.umkc.edu>
To: topmind@technologist.com, kcpm@listbot.com
Subject: Re: Perl Criticism
Message-Id: <369BE0E2.3C35D477@kasey.umkc.edu>
topmind@technologist.com wrote:
>
> I made no points??????? I have an 80k webpage and it has no points?
> What are you talking about?
hmmm.
http://www.geocities.com/SiliconValley/Lab/6888/langopts.htm
Having read the first half of the page, down to where you say that
you are not fond of zeroes, I feel compelled to share that all the
points are grounded in unexpanded personal preference, which is fine
with me, since you aren't trying to do anything other than share your
views.
"Excel" is a "table oriented programming" language, right? I'm glad
to have a word for that paradigm, I didn't before. Also I wonder if
you have ever used or looked at python, the python users of the world
are every bit as fanatical as the perl users but their language may
be more to your liking.
Reading through the wish list in the second half of the article I
find myself thinking, "You can do that in perl, like this ... " for
each and every one of the wishes. (Examples available for premium
subscribers only.) I wonder if it is possible to do all of those
things with python.
______________________________________________________________________
David Nicol 816.235.1187 UMKC Network Operations david@news.umkc.edu
You are free to believe that America maintains a manned moon base.
------------------------------
Date: Tue, 12 Jan 1999 23:28:35 GMT
From: tariqx@my-dejanews.com
Subject: Perl on Solaris 2.6 breaking (ftp.pl)
Message-Id: <77glql$b9b$1@nnrp1.dejanews.com>
Hello All: I have a Sun Ultra 1 running Solaris 2.6. I had perl 5.004
installed on it for a while now and been working just fine. I needed to use
to ftp.pl for a small ftp script in perl. It broke on chat2.pl not finding
socket.ph ! i finally found out that I had to run h2ph since it didn't run
for some reason! I also downloaded the binary distributon of perl 5.005_02
and recompiled it and re-ran h2ph. The script is: #!/apps/local/bin/perl
require "ftp.pl";
$ftpHost = "<my dest-host-name>";
if (&ftp::open($ftpHost,21,0,1) !=1) {
die "Can't open $ftpHost\n" ;
}
if (&ftp::login("<my_user_id>","<my_password>") != 1 ) {
die "Can't Login\n";
}
if (($PWD=&ftp::pwd) eq "") {
die "Can't get pwd" ;
}
print "pwd=$PWD" ;
&ftp::close
The script breaks with these messages: Bareword found where operator expected
at /apps/local/lib/perl5/site_perl/5.005/ sun4-solaris/sys/feature_tests.ph
line 20, near """invalid" (Missing operator before invalid?) Bareword found
where operator expected at /apps/local/lib/perl5/site_perl/5.005/
sun4-solaris/sys/feature_tests.ph line 20, near "invalid _FILE_OFFSET_BITS"
(Do you need to predeclare invalid?) String found where operator expected at
/apps/local/lib/perl5/site_perl/5.005/su n4-solaris/sys/feature_tests.ph line
20, near "specified""" syntax error at
/apps/local/lib/perl5/site_perl/5.005/sun4-solaris/sys/feature_t ests.ph line
20, near """invalid "
ANY ideas?
PLEAS HELP
email me at : tshureih@standard.com
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 12 Jan 1999 16:52:06 -0500
From: Uri Guttman <uri@ibnets.com>
Subject: Re: prog1 lookalike in Perl?
Message-Id: <39ww2s40s9.fsf@ibnets.com>
>>>>> "Hrvoje" == Hrvoje Niksic <hniksic@srce.hr> writes:
Hrvoje> Per Kistler <kistler@gmx.net> writes:
>> Do you mean like this?:
Hrvoje> [...]
>> sub foo($);
>> sub foo($){
>> $_ = $_[0];
>> /^begin/ and $change = 1 and return "# $_";
>> /^end/ and $change = 0;
>> $_;
>> }
Hrvoje> In this example, you wiggled out by return-ing from the sub.
Hrvoje> However, in the general case you cannot use return.
is last allowed?
sub foo($){
$_ = shift ;
{
/^begin/ and do {
$change = 1 ;
substr( $_, 0, 0 ) = '# ' ;
last ;
}
/^end/ and do {
$change = 0;
last ;
}
}
$_;
}
hth,
uri
--
Uri Guttman Hacking Perl for Ironbridge Networks
uri@sysarch.com uri@ironbridgenetworks.com
------------------------------
Date: Tue, 12 Jan 1999 17:22:04 -0600
From: David L Nicol <david@kasey.umkc.edu>
Subject: Re: Randal's code [was Re: How do I delete tmp files based on age?]
Message-Id: <369BD91C.BC3C5CC9@kasey.umkc.edu>
Uri Guttman wrote:
> use pushdir ;
>
> {
> pushdir $dirname ;
>
> unlink grep -A > $hold_time, readdir DIR;
> }
>
> automatic popd occurs on block exit so we are back to where we were!
>
> uri
>
> --
> Uri Guttman Hacking Perl for Ironbridge Networks
> uri@sysarch.com uri@ironbridgenetworks.com
What's wrong with just using "find" for this kind of thing?
system "find $dirname ! -newer $most_recent_doomed_file -exec rm {} \;";
______________________________________________________________________
David Nicol 816.235.1187 UMKC Network Operations david@news.umkc.edu
You are free to believe that America maintains a manned moon base.
------------------------------
Date: 12 Jan 1999 15:46:27 -0800
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Randal's code [was Re: How do I delete tmp files based on age?]
Message-Id: <m1u2xw6omk.fsf@halfdome.holdit.com>
>>>>> "David" == David L Nicol <david@kasey.umkc.edu> writes:
David> What's wrong with just using "find" for this kind of thing?
David> system "find $dirname ! -newer $most_recent_doomed_file -exec rm {} \;";
1) doesn't work if $dirname has shell-sensitive chars
2) doesn't work if $most_recent_doomed_file has shell-sensitive chars
3) fires off at least one more process (maybe two)
4) fires off one rm per file to be deleted (ugh!)
so, not much, but hey, we can do nearly all those steps in Perl... so
why bother calling external things and potentially shooting ourselves
in the foot?
print "Just another Perl hacker,"
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: Tue, 12 Jan 1999 22:23:38 GMT
From: John@melon17.freeserve.co.uk (John )
Subject: Read file problem
Message-Id: <369bcb02.11786603@news.freeserve.net>
When i use:
open(INF,file$) || die "Can't open file$\n";
the script tries to download the file rather than
read it.
Any suggestions?
John
------------------------------
Date: 12 Jan 1999 22:32:49 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: Read file problem
Message-Id: <slrn79njch.stm.sholden@pgrad.cs.usyd.edu.au>
On Tue, 12 Jan 1999 22:23:38 GMT, John <John@melon17.freeserve.co.uk> wrote:
>When i use:
>
>open(INF,file$) || die "Can't open file$\n";
>
>the script tries to download the file rather than
>read it.
No it doesn't. It just plain doesn't compile since the $s are in the wrong
place.
--
Sam
Just don't create a file called -rf. :-)
--Larry Wall
------------------------------
Date: Tue, 12 Jan 1999 12:50:31 -0500
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: regulart expression
Message-Id: <x3yaezo5qjc.fsf@tigre.matrox.com>
Andre Arpin <arpin@adan.kingston.net> writes:
>
> I have an array and would like to find out if any element of the array
> does not contain the word 'not'
>
> what I would like is the eqivalent of
> grep -v not
>
RTFM .. but ...
@new_ary = grep { !/\bnot\b/ } @ary;
------------------------------
Date: Tue, 12 Jan 1999 22:29:50 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Verify an email address
Message-Id: <369ccbc8.3957950@news.skynet.be>
Randal L. Schwartz wrote:
>What "Email::Valid" module?
>If it's not in the CPAN, it doesn't exist.
But the Perl Reference knows about it.
http://reference.perl.com/query.cgi?mail+index
>Email::Valid -- Module
>This module determines whether an e-mail address conforms to the
>RFC822 specification. Optionally, additional tests/modifications are
>performed on the address to correct common addressing errors, identify
>invalid addresses within specific domains, verify that a DNS entry
>exists for the domain, and ensure that the address is fully qualified.
> http://olympia2.adhost.com/~maurice/
Bart.
------------------------------
Date: Tue, 12 Jan 1999 17:48:44 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Verify an email address
Message-Id: <fl_aggie-1201991748440001@aggie.coaps.fsu.edu>
In article <GLOm2.69$N4.10552@news.shore.net>, Scratchie
<upsetter@ziplink.net> wrote:
+ it, all the errors I came up with were clearly wrong (things like
+ "myName@aol" or "my Name@aol.com")
Did you write to fix this according to your best guess?
James
------------------------------
Date: 12 Jan 1999 15:43:50 -0800
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Verify an email address
Message-Id: <m1yan86oqx.fsf@halfdome.holdit.com>
>>>>> "Bart" == Bart Lateur <bart.lateur@skynet.be> writes:
Bart> But the Perl Reference knows about it.
Bart> http://reference.perl.com/query.cgi?mail+index
>> Email::Valid -- Module
>> This module determines whether an e-mail address conforms to the
>> RFC822 specification. Optionally, additional tests/modifications are
>> performed on the address to correct common addressing errors, identify
>> invalid addresses within specific domains, verify that a DNS entry
>> exists for the domain, and ensure that the address is fully qualified.
>> http://olympia2.adhost.com/~maurice/
This is broken then. It should be in the CPAN. If it's not in the CPAN,
I can't easily convince people to use it.
I was only half joking when I said "if it's not in the CPAN, it
doesn't exist".
print "Just another Perl hacker,"
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: Tue, 12 Jan 1999 16:07:45 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Were to learn PERL Online.
Message-Id: <h3hg77.9h.ln@magna.metronet.com>
Jeff (jeffm@shaw.wave.ca) wrote:
: I have had experience programming in C before, and I am trying to get into
: the web development area to make some money in my spare time when I don't
: have too much homework... Does anyone have a web site that I can learn perl
: from, which won't waste too much time explaining concepts which I allready
: know from C?
Learn to use the hundreds of pages that were installed on
your hard disk when you installed perl:
perl -n -e 'print if /^=/ && /learn/i' perlfaq*.pod
=item L<perlfaq2>: Obtaining and Learning about Perl
=head2 Is Perl difficult to learn?
=head2 How do I learn about object-oriented Perl programming?
=head2 Where can I learn about CGI or Web programming in Perl?
=head2 Where can I learn about object-oriented Perl programming?
=head2 Where can I learn about linking C with Perl? [h2xs, xsubpp]
: Do you recomend any books?
"Learning Perl" (the Llama book - tutorial)
"Programming Perl" (the Camel book - reference)
Perl FAQ, part 2:
--------------------------
=head2 Perl Books
A number of books on Perl and/or CGI programming are available. A few of
these are good, some are ok, but many aren't worth your money. Tom
Christiansen maintains a list of these books, some with extensive
reviews, at http://www.perl.com/perl/critiques/index.html.
--------------------------
... it then goes on to list about a dozen books.
Use the docs Luke.
: Please e-mail me back!
Nope.
Ask it here, get the answer here.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 12 Jan 1999 22:19:42 GMT
From: dy257@cleveland.Freenet.Edu (Yao Xu)
Subject: where is the lexical parser ?
Message-Id: <77ghpu$ei8$1@pale-rider.INS.CWRU.Edu>
Can some one point out to me which file or group of files
which are the lexical parsing functions in Perl (language
itself)?
Thanks
Yao
------------------------------
Date: 12 Jan 1999 22:30:46 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: where is the lexical parser ?
Message-Id: <77giem$8vs$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Yao Xu
<dy257@cleveland.Freenet.Edu>],
who wrote in article <77ghpu$ei8$1@pale-rider.INS.CWRU.Edu>:
>
>
> Can some one point out to me which file or group of files
> which are the lexical parsing functions in Perl (language
> itself)?
If you look for yylex(), you find it in toke.c.
Ilya
------------------------------
Date: 12 Jan 1999 23:21:42 GMT
From: dy257@cleveland.Freenet.Edu (Yao Xu)
Subject: white paper on how Perl interpreter works or designed ?
Message-Id: <77gle6$scs$1@pale-rider.INS.CWRU.Edu>
Guys,
are there any white papers on how Perl interpreter
works and is designed ?
Thanks
Yao
------------------------------
Date: Tue, 12 Jan 1999 22:51:17 GMT
From: leonardd@mindspring.net (Douglas Leonard)
Subject: Win32::ODBC, Perl SQL vs. standard SQL
Message-Id: <369bcde1.7589865@172.17.12.1>
I am looking for a list of character differences between standard SQL
and SQL commands run from Perl using Win32::ODBC.
I know there are some differences in how certain characters are
implemented, but I need a list of exactly which characters and
commands are different. I have done some searching on the net through
such pages as Dave Roth's great site, but I haven't found any
comprehensive documents on what I am looking for.
Anyway, thanks in advance;
<Douglas Leonard>
------------------------------
Date: Tue, 12 Jan 1999 14:12:45 -0800
From: Billy Vitro <bvitro@cisco.com>
Subject: Re: Year 2038 problem
Message-Id: <369BC8DD.2E0368CF@cisco.com>
Well, that makes me feel soooo much better. I just tried the code below
on my "Y2K Compliant" Solaris 2.6 (Ultra 60). Here's what I got:
1 > perl5 -e 'print (scalar localtime 2**31, "\n")'
Mon Jan 18 19:14:08 2038
2 > perl5 -e 'print (scalar localtime 2**32, "\n")'
Wed Dec 31 15:59:59 1969
4 > perl5 -e 'print (scalar localtime 2**55, "\n")'
Wed Dec 31 15:59:59 1969
5 > perl5 -v
This is perl, version 5.004_04 built for sparc-sun-solaris2.6
Yummy.
Guess that means I can't figure out what my options will be worth in
2039...
<sigh> The Miracle Of Modern Technology
Billy.
Michal Jaegermann wrote:
>
> Bart Lateur (bart.lateur@skynet.be) wrote:
> : John Robson wrote:
> Hardly. :-)
>
> perl -e 'print (scalar localtime 2**55, "\n")'
> Sat Jun 12 23:26:08 1141709097
>
> This is Perl and Linux (on Alpha machine, but so what :-).
>
> Width of time_t type is really not prescribed although on 32-bit
> machine it is convenient to have it as a signed 32-bit type.
> This is really something for a particular implementation of underlying
> libraries to resolve and has nothing to do with Perl (or Linux, for
> that matter). Besides your applications do not have to use time_t
> to represent dates; check, for example, a range of avaialable
> dates in Oracle on any platform. (The fact that Oracle does not
> have any sane provisions to keep dates time zone independent is
> another story.)
>
> --mj
------------------------------
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 4633
**************************************