[19620] in Perl-Users-Digest
Perl-Users Digest, Issue: 1815 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Sep 25 18:08:11 2001
Date: Tue, 25 Sep 2001 15:05:14 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <1001455514-v10-i1815@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Tue, 25 Sep 2001 Volume: 10 Number: 1815
Today's topics:
32 bit numbers? (MrStugatz)
Re: 32 bit numbers? (Mark Jason Dominus)
Re: 32 bit numbers? (Logan Shaw)
Book Recommendations (RoJo)
Re: Can not grab program output on error (Malcolm Dew-Jones)
Coding pratices (Dylan Riley)
Re: Coding pratices <mjcarman@home.com>
Re: command line file operations <goldbb2@earthlink.net>
Re: Creating modules <bart.lateur@skynet.be>
Re: faster execution <goldbb2@earthlink.net>
Re: Handling two lines (Malcolm Dew-Jones)
Help: How can I catch the error with my perl ? (Mike F)
Re: Help: How can I catch the error with my perl ? <rsherman@ce.gatech.edu>
Re: How do I get a list of files in a directory using p <scott.bell1@ntlworld.com>
How to fetch all html files under a web directory (baobaoba)
Re: How to fetch all html files under a web directory <Tassilo.Parseval@post.rwth-aachen.de>
Re: How to remove whitespace without losing the 'real' (RiCaRdO)
how to set baud on serial port on linux box <aschlies@ezwv.com>
Installing libnet on AIX 4.3.3 (Rob)
Logical AND? (Newbie) (MrStugatz)
Re: Logical AND? (Newbie) <tony_curtis32@yahoo.com>
Re: Logical AND? (Newbie) (Logan Shaw)
Moderators Needed <andy@gametribe.net>
Not sure what type of cgi script I need! (Snipes)
OOP With perl <webmaster@kwakeb.net>
Re: OOP With perl (David Wall)
Re: OOP With perl (Randal L. Schwartz)
Re: OOP With perl <mjcarman@home.com>
Problem with Socket and sysread() <d_munzinger@yahoo.de>
Re: quick regular expression question, please help! nobull@mail.com
Re: setting error return values <goldbb2@earthlink.net>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 25 Sep 2001 13:00:24 -0700
From: bakala_2000@yahoo.com (MrStugatz)
Subject: 32 bit numbers?
Message-Id: <d6f760a6.0109251200.44e63fd4@posting.google.com>
Hi,
I am trying to AND together two 32 bit numbers, my result is only the
lower 16 bits of it. How can I get around this?
------------------------------
Date: Tue, 25 Sep 2001 20:04:19 GMT
From: mjd@plover.com (Mark Jason Dominus)
Subject: Re: 32 bit numbers?
Message-Id: <3bb0e343.39a$2ec@news.op.net>
In article <d6f760a6.0109251200.44e63fd4@posting.google.com>,
MrStugatz <bakala_2000@yahoo.com> wrote:
> I am trying to AND together two 32 bit numbers, my result is only the
>lower 16 bits of it. How can I get around this?
Please show us your code. Perl does not normally behave the way you
have described:
perl -e 'printf "%x\n", 0xf0f0f0f0 & 0x12345678'
10305070
--
@P=split//,".URRUU\c8R";@d=split//,"\nrekcah xinU / lreP rehtona tsuJ";sub p{
@p{"r$p","u$p"}=(P,P);pipe"r$p","u$p";++$p;($q*=2)+=$f=!fork;map{$P=$P[$f^ord
($p{$_})&6];$p{$_}=/ ^$P/ix?$P:close$_}keys%p}p;p;p;p;p;map{$p{$_}=~/^[P.]/&&
close$_}%p;wait until$?;map{/^r/&&<$_>}%p;$_=$d[$q];sleep rand(2)if/\S/;print
------------------------------
Date: 25 Sep 2001 15:10:22 -0500
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: 32 bit numbers?
Message-Id: <9oqobe$815$1@charity.cs.utexas.edu>
In article <d6f760a6.0109251200.44e63fd4@posting.google.com>,
MrStugatz <bakala_2000@yahoo.com> wrote:
> I am trying to AND together two 32 bit numbers, my result is only the
>lower 16 bits of it. How can I get around this?
Can you give a code example? I don't experience the problem:
$ perl -le '$x = 2**17; print $x & $x'
131072
- Logan
--
"Everybody
Loves to see
Justice done
On somebody else" ( Bruce Cockburn, "Justice", 1981 )
------------------------------
Date: Tue, 25 Sep 2001 21:46:55 GMT
From: rojo@mindspring.com (RoJo)
Subject: Book Recommendations
Message-Id: <3bb0fa58.73725471@news.mindspring.com>
I'd like to get a good book on PERL 5. I've already got the Pocket
Reference. I can find my way around the pod documentation, but I need
more. I need a book that emphasizes examples. Suggestions?
------------------------------
Date: 25 Sep 2001 11:09:58 -0800
From: yf110@vtn1.victoria.tc.ca (Malcolm Dew-Jones)
Subject: Re: Can not grab program output on error
Message-Id: <3bb0c876@news.victoria.tc.ca>
novastar (novastar@novastar.dtdns.net) wrote:
: I was writing a big perl program, and everything was fine untill the point I
: had to grab a program output on fault conditions. Disaster, perl returned
: absolute nothing ( WinNT4 )
: @output=`dir /zz`;
: foreach (@output) { print "$_\n"; }
: The @output array is completely empty. It is not the dir command but a good
: example to the situation I face, please help.
On nt you can redirect stderr, so the following may work
@output=`dir /zz 2>&1`;
--
Want to access the command line of your CGI account? Need to debug your
installed CGI scripts? Transfer and edit files right from your browser?
What you need is "ispy.cgi" - visit http://nisoftware.com/ispy.cgi
------------------------------
Date: Tue, 25 Sep 2001 18:45:40 GMT
From: dylan_r.nospam@invalid.yahoo.com (Dylan Riley)
Subject: Coding pratices
Message-Id: <Xns9127972498EC0billwhitehousegov@207.35.177.135>
Hello all,
I was wondering how you guys approach a new coding project in terms
of file size and external libraries. Do you mostly keep core
objects/sub in one file and "farm out" tasks to various support
libraries or do you keep everything in one big file? Is there a clear
cut rule to follow where one might decide to include code in
modules/libraries/external files rather than keep all code in a
single file?
I'm faced with the dilema of either making the script bigger and
bigger or cutting it into a bunch of smaller interconnected files.
Tia
--
Dylan <dylan_r(at)yahoo(dot)com>
------------------------------
Date: Tue, 25 Sep 2001 15:03:04 -0500
From: Michael Carman <mjcarman@home.com>
Subject: Re: Coding pratices
Message-Id: <3BB0E2F8.25651ACD@home.com>
Dylan Riley wrote:
>
> I was wondering how you guys approach a new coding project in terms
> of file size and external libraries. Do you mostly keep core
> objects/sub in one file and "farm out" tasks to various support
> libraries or do you keep everything in one big file? Is there a clear
> cut rule to follow where one might decide to include code in
> modules/libraries/external files rather than keep all code in a
> single file?
This is essentially a stylistic issue, and when it comes to coding style
there are as many views as there are programmers. There are no hard and
fast rules. If you have a coding standard, follow that. If not, use your
own judgement.
As a general rule; if you have a piece of functionality that you may
want to use in multiple scripts, it makes sense to factor it out and
make it into a module. Anything unique to the current script normally
goes in the main file.
> I'm faced with the dilema of either making the script bigger and
> bigger or cutting it into a bunch of smaller interconnected files.
At some (arbitrary) point, it's probably a good idea to break it apart.
It will make maintenance easier. When you reach that point, try to find
logical subsets of the functionality and break things apart that way.
-mjc
------------------------------
Date: Tue, 25 Sep 2001 14:50:12 -0400
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: command line file operations
Message-Id: <3BB0D1E4.8DBA0F3C@earthlink.net>
Benjamin Goldberg wrote:
>
> Chucko wrote:
> >
> > Does anyone know how to (from a command line) read in a file of
> > text, keep each word read, discard the duplicates then write the
> > kept words to a file?
>
> perl -lne 'print if !$seen{$_}++ for split' < infile > outfile
Hmm, or:
perl -lne 'print if !$seen{$_}++ for /\w+/g' < infile > outfile
Depending of course on your definition of a word.
Another possible modification is:
perl -lne 'print if !$seen{lc $_}++ for /\w+/g' < infile > outfile
Which will make "The" and "the" act like the same word when testing for
if it's been printed or not.
--
"I think not," said Descartes, and promptly disappeared.
------------------------------
Date: Tue, 25 Sep 2001 19:46:44 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Creating modules
Message-Id: <ubn1rt8os496978om6pf2qg9ce405m0p7k@4ax.com>
nobull@mail.com wrote:
>+ *{"${callpkg}::EXPORT"} = \@{$arg{EXPORT} || []} ;
>+ *{"${callpkg}::EXPORT_OK"} = \@{$arg{EXPORT_OK} || []};
This does not do what you think it does.
$ref = [ qw(a b c)];
$\ = "\n";
print $ref;
print \@{$ref};
-->
ARRAY(0x176f134)
ARRAY(0x176f134)
If you want a copy of the argument passed, by all means, make a copy; if
not, keep it simple.
+ *{"${callpkg}::EXPORT"} = [ @{$arg{EXPORT} || [] } ]; # copy
+ *{"${callpkg}::EXPORT"} = $arg{EXPORT} || []; # no copy
--
Bart.
------------------------------
Date: Tue, 25 Sep 2001 15:49:38 -0400
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: faster execution
Message-Id: <3BB0DFD2.7EF5059F@earthlink.net>
venus wrote:
>
> Hi all,
>
> I wrote a perl script but I'm not sure if there's a better way of
> doing it.
> The script runs very slow because the input file (txt file) I'm
> reading from is very big. The script reads the input text file and if
> it finds any location that equals to the list in array, it will
> replace it with location code.
> Here's a part of the script:
my %LOCATION = ....;
my $StartDD;
while( <INPUT_FILE> ) {
chomp;
my @data = split /,/;
my $loc_code = $LOCATION{join ",", splice(@data, 0, 3)};
my ($min3, $max3, $wx3) = (@data[10,9], $CONDITION{$data[11]});
$StartDD = $data[0] if !defined $StartDD;
printf FILE "%s,%4s,%4s,%1s\n", $loc_code, $min2, $max3, $wx3;
}
close INPUT_FILE;
close FILE;
--
"I think not," said Descartes, and promptly disappeared.
------------------------------
Date: 25 Sep 2001 14:53:30 -0800
From: yf110@vtn1.victoria.tc.ca (Malcolm Dew-Jones)
Subject: Re: Handling two lines
Message-Id: <3bb0fcda@news.victoria.tc.ca>
David Djajaputra (whatafish@hotmail.com) wrote:
: Hello all,
: I'm trying to write a perl script that can help me convert my
: Fortran77 programs into Fortran90. My question is about multiline
: statement.
: In fixed-format F77, multiline statement goes like this:
: xxxxx line1
: >line2
: (Statements start on column 7, continuation line is denoted by a
: non-blank column 6. Anything can be used other than blank or zero.)
: xxxxx can be numbers, it's used for labeling.
: In Fortran90, it doesn't care about fixed format. Continuation line
: symbol is appended at the end of the *first* line, and it uses an
: ampersand (&):
: line1 &
: line2
: My question is: What's the best way to do this conversion with perl?
: Perhaps a one-liner?
What's best - who knows, but the following was easy to think up (though
its untested). I don't know what is supposed to happen to the xxxxx part,
so I just removed it in all cases. This does a slurp. I can't imagine a
fortran program big enough to be unslurpable.
@fortran = <>;
for ($i=0; $i<@fortran; $i++)
{
my ($label,$continuation,$line) =
$fortran[$i] =~ m/^(.....)(.)(.*)/;
$fortran[$i] = $line;
# assume no erroneous continuation on first line
$fortran[$i-1] .= ' &' if $continuation !~ m/ |0/ ;
}
print "$_\n" foreach (@fortran);
------------------------------
Date: Tue, 25 Sep 2001 19:36:14 GMT
From: u518615722@spawnkill.ip-mobilphone.net (Mike F)
Subject: Help: How can I catch the error with my perl ?
Message-Id: <l.1001446574.1382751464@[64.94.198.252]>
Hi, Folks
I have a perl scripts like this:
------------------------------------------------------
sub trap_die
{
my @param = @_;
$message = $param[0];
$CommandString = "/bin/mailx -s \"$message\" xxxx\@yyyy.com ";
system ( $CommandString );
}
use strict;
use DBI;
my $dbh = DBI->connect ( 'dbi:Oracle:test',
'system',
'manager',
{
PrintError => 0,
RaiseError => 1,
AutoCommit => 1
}
) || die "Database Connection not made
$DBI::errstr" ;
my $sql = qq{ select * from global_name}
my $sth = $dbh ->prepare($sql);
$sth->execute();
while (my @rows = $sth->fetchrow_array) {
print "@rows[0]\n";
}
$sth->finish();
$dbh->disconnect();
-------------------------------------------------------
For any reason there is an error, perl will exit. Everyday I have to
read output files to see whether there is an error, how can I make a
perl call my sub function TRAP_DIE so that when error, I will get an
email?
I tried to put the line
if ($dbh->error) {trap_die("error");}
but it will not work because the perl will exit as soon as it raise
error.
Thanks for your help.
--
Sent by dbadba62 from hotmail included in com
This is a spam protected message. Please answer with reference header.
Posted via http://www.usenet-replayer.com/cgi/content/new
------------------------------
Date: Tue, 25 Sep 2001 16:03:38 +0500
From: Robert Sherman <rsherman@ce.gatech.edu>
Subject: Re: Help: How can I catch the error with my perl ?
Message-Id: <3BB0648A.AA1F9DDC@ce.gatech.edu>
Mike F wrote:
>
> Hi, Folks
> I have a perl scripts like this:
> ------------------------------------------------------
> sub trap_die
> {
> my @param = @_;
> $message = $param[0];
> $CommandString = "/bin/mailx -s \"$message\" xxxx\@yyyy.com ";
> system ( $CommandString );
> }
> use strict;
> use DBI;
>
> my $dbh = DBI->connect ( 'dbi:Oracle:test',
> 'system',
> 'manager',
> {
> PrintError => 0,
> RaiseError => 1,
> AutoCommit => 1
> }
> ) || die "Database Connection not made
> $DBI::errstr" ;
> my $sql = qq{ select * from global_name}
> my $sth = $dbh ->prepare($sql);
> $sth->execute();
> while (my @rows = $sth->fetchrow_array) {
> print "@rows[0]\n";
> }
> $sth->finish();
> $dbh->disconnect();
> -------------------------------------------------------
> For any reason there is an error, perl will exit. Everyday I have to
> read output files to see whether there is an error, how can I make a
> perl call my sub function TRAP_DIE so that when error, I will get an
> email?
> I tried to put the line
>
> if ($dbh->error) {trap_die("error");}
> but it will not work because the perl will exit as soon as it raise
> error.
one option is to use eval to trap the potential error, then take action
based on the results, like so:
$success = eval { killer_kode_goes_here };
if (!$success) { print " something did not work \n the error was: $@ " }
--
robert sherman
css, cee
georgia institute of technology
atlanta, ga, usa
------------------------------
Date: Tue, 25 Sep 2001 22:03:55 +0100
From: "Scott Bell" <scott.bell1@ntlworld.com>
Subject: Re: How do I get a list of files in a directory using perl?
Message-Id: <Y36s7.3951$L4.871692@news6-win.server.ntlworld.com>
Thanks, I got it working. :)
--
Scott Bell
Email: scott.bell1@ntlworld.com
The content of this message has been certified 100% correct.
Scott Bell <scott.bell1@ntlworld.com> wrote in message
news:H2Mr7.3313$2K4.718824@news6-win.server.ntlworld.com...
> I'm writing a webpage that gives the user a list of files in a directory,
so
> far I have this:
>
> $dir = parse_dir("", '+0000');
> print $dir;
>
> When I view the webpage it just gives me ARRAY(0x17a2454), so what am I
> doing wrong?
>
>
> --
> Scott Bell
> Email: scott.bell1@ntlworld.com
>
> The content of this message has been certified 100% correct.
>
>
>
------------------------------
Date: 25 Sep 2001 11:13:47 -0700
From: baobaoba@yahoo.com (baobaoba)
Subject: How to fetch all html files under a web directory
Message-Id: <25212a12.0109251013.886eff1@posting.google.com>
I am trying to download all html files from a website, suppose it is:
http://www.abc.com/some_directory/
I know there are a lot of html files under "some_directory", but I don't know
their names and how many there are. I just want grab them all to my local directory.
The HTTP::Request moudle requires actual URL, which looks not work for my case.
Does anybody have any idea how to do it?
------------------------------
Date: Tue, 25 Sep 2001 20:32:23 +0200
From: Tassilo von Parseval <Tassilo.Parseval@post.rwth-aachen.de>
Subject: Re: How to fetch all html files under a web directory
Message-Id: <3BB0CDB7.9010101@post.rwth-aachen.de>
baobaoba wrote:
> I am trying to download all html files from a website, suppose it is:
>
> http://www.abc.com/some_directory/
>
> I know there are a lot of html files under "some_directory", but I don't know
> their names and how many there are. I just want grab them all to my local directory.
> The HTTP::Request moudle requires actual URL, which looks not work for my case.
> Does anybody have any idea how to do it?
HTTP itself as the protocol in question does not support such a thing.
To get a particular document you have to explicitly name it.
There may be the chance that a particular server has a robots.txt lying
around which you could then retrieve and examine its content. That's
what wget does when using the -r (recursive) switch.
Tassilo
--
$a=[(74,116)];$b=[($a->[1]-1,$a->[1]++,0x20)];$c=[(97,110)];$d=[($c->
[1]+1,$b->[1],"her")];for(@{[$a,$b,$c,$d]}){for(@{$_}){$_=~/\d+/?print
(chr($_)):print;}}$c=sub{$l=shift;[(0x20+$l-1,0x50,0x65,0x73-0x01,108
),(0x20,0x68,0x61,)]};print(map{chr($_)}@{($c->(1))});$h={a=>33*3,b=>
10**2+7,c=>"1"."0"."1",d=>0162};@h=sort(keys(%$h));for(@h){print(chr(
ord(chr($h->{$_}))))};
------------------------------
Date: Tue, 25 Sep 2001 19:58:05 GMT
From: rdok@netscape.net (RiCaRdO)
Subject: Re: How to remove whitespace without losing the 'real' whitespace?
Message-Id: <3bb0e013.4777940@ricardo.tuus.nl>
>
>Hope that helps.
>
> - Logan
This most certainly helps! In fact it's like I expected it to be (not
the actual code of course!): there must be a much quicker way but I
hadn't yet found it. Thanks everybody, you're a great help.
BTW the output of rmtshare (NT resource kit I guess) doesn't use TABs
although it looks a lot like it. columns are separated by as much
whitespace as is needed to make the text appear in columns. Good to
read & (as I know now) easy to use in a script!
Cheers,
RiCaRdO.
------------------------------
Date: Tue, 25 Sep 2001 16:59:58 -0400
From: "Tony Schliesser" <aschlies@ezwv.com>
Subject: how to set baud on serial port on linux box
Message-Id: <3bb0edd6_1@corp.newsgroups.com>
Consider the following bit of code on a linux box:
if (open(PHONE,"/dev/$serial")) {
while (<PHONE>) {
This works fine when the linux box decides to boot up and have the serial
port setup for the right speed. Ideally, I would like to set up the port
for n81 at 2400 baud - however I am not sure how to accomplish this in perl.
I don't consider myself a perl developer so please be gentle with any
suggestions. :)
Thanks
Tony
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 80,000 Newsgroups - 16 Different Servers! =-----
------------------------------
Date: 25 Sep 2001 12:52:12 -0700
From: robsjobs@hotmail.com (Rob)
Subject: Installing libnet on AIX 4.3.3
Message-Id: <4ae33a7b.0109251152.17c1a640@posting.google.com>
I cannot get (in particular, Net::FTP,) libnet to install correctly on
AIX 4.3.3 with perl 5.6.1
When I do a make test, it states that it is skipping t/ftp. Is there
a particular method to get this to install? I see other posts where
people are aparently using it so I presume it will work. Can 'make'
be the problem? I have not received permission from the client to
install the gnu make so I am using IBM's.
Thanks for your input!
Robert
------------------------------
Date: 25 Sep 2001 12:30:27 -0700
From: bakala_2000@yahoo.com (MrStugatz)
Subject: Logical AND? (Newbie)
Message-Id: <d6f760a6.0109251130.621efd75@posting.google.com>
Newbie here.
I am trying to AND together to numbers, for example 456 AND 302. I
want to have the AND binary value represented as a decimal.
The Perl FAQs say to use "&&" or "and", and they do not seem to work.
Is there a way to AND two decimal numbers?
Thanks.
------------------------------
Date: Tue, 25 Sep 2001 14:34:52 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: Logical AND? (Newbie)
Message-Id: <87u1xrm5cz.fsf@limey.hpcc.uh.edu>
>> On 25 Sep 2001 12:30:27 -0700,
>> bakala_2000@yahoo.com (MrStugatz) said:
> Newbie here. I am trying to AND together to numbers,
> for example 456 AND 302. I want to have the AND binary
> value represented as a decimal.
You want it printed out as a decimal numeral.
> The Perl FAQs say to use "&&" or "and", and they do not
> seem to work.
Yes they do. You just misunderstand what they do :-)
> Is there a way to AND two decimal numbers?
"&&" is logical-and, "&" is bitwise.
(perldoc perlop)
--
Yes way! Mmmmkay?
------------------------------
Date: 25 Sep 2001 15:06:56 -0500
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: Logical AND? (Newbie)
Message-Id: <9oqo50$806$1@charity.cs.utexas.edu>
In article <d6f760a6.0109251130.621efd75@posting.google.com>,
MrStugatz <bakala_2000@yahoo.com> wrote:
>Newbie here.
>
>I am trying to AND together to numbers, for example 456 AND 302. I
>want to have the AND binary value represented as a decimal.
>
>The Perl FAQs say to use "&&" or "and", and they do not seem to work.
>
>Is there a way to AND two decimal numbers?
You are saying what you want is logical AND, but what you really want
is arithmetic AND. So you want to use the "&" operator, which does
arithmetic AND:
$ perl -le 'print 6 & 3'
2
Hope that helps.
- Logan
--
"Everybody
Loves to see
Justice done
On somebody else" ( Bruce Cockburn, "Justice", 1981 )
------------------------------
Date: Tue, 25 Sep 2001 21:57:53 +0100
From: "Gametribe News" <andy@gametribe.net>
Subject: Moderators Needed
Message-Id: <9oqq6g$d22$1@uranium.btinternet.com>
Hi,
We are looking for some technical peeps to moderate our new forums (only
launched them in the last 24 hours).
We are looking for HTML, Flash, Coding (General), Perl / CGI and Java. More
will be getting added soon.
To apply, go to http://www.gametribe.net and follow the forum link.
We are also holding a draw for a Gameboy Advance and Mario.
Please drop by if you are interested - you might also find our other
services of use to you.
Cheers,
Andy
------------------------------
Date: 25 Sep 2001 14:27:13 -0700
From: pilotsnipes@yahoo.com (Snipes)
Subject: Not sure what type of cgi script I need!
Message-Id: <ae7dfa3b.0109251327.19e776@posting.google.com>
Would anyone be kind enough to recommend a script for me to run on a
web server at work? Every Friday an e-mail with 6 attachments are
delivered to my e-mail account, they are small, simple .html files
which contain the next weeks roster information for 6 different groups
of people.
I then upload them to the webserver and make them available to anyone
who wants to log on and download the particular file (ie, their
roster) that they are interested in. Very few people if any, are
interested in getting all 6.
I would like to be able to have a "mailing list" or something similar,
that the users can subscribe to which allows them to select which of
the 6 files they want to receive to their own e-mail. When the e-mail
arrives on Friday to my account, I would like the server to run a
script/program that takes each attachment and "forwards" or
"auto-responds" it to the people who are looking for it.
It is a mailing list I'm looking for? Or perhaps an e-mail manager, I
honestly don't know myself and I need some help!
Anyone with any suggestions? Thank you for your time and I appreciate
your help!
Regards,
Snipes.
------------------------------
Date: Tue, 25 Sep 2001 23:02:56 +0300
From: "eDeveloper" <webmaster@kwakeb.net>
Subject: OOP With perl
Message-Id: <9oqo6o$7g1$1@ns1.isu.net.sa>
Hi all
I'm a c++ and perl developer
I know that both of C++ and perl are support Objects
In C++ , I know how to create classes and objects
In perl, how to create objects ..
for example : I want to create a class in a module .. then use it by
creating objects
I hope you understand me :-)
Regards,
eDeveloper
------------------------------
Date: Tue, 25 Sep 2001 20:26:12 -0000
From: darkon@one.net (David Wall)
Subject: Re: OOP With perl
Message-Id: <Xns9127A71577161darkononenet@207.126.101.97>
"eDeveloper" <webmaster@kwakeb.net> wrote on 25 Sep 2001:
> I'm a c++ and perl developer
>
> I know that both of C++ and perl are support Objects
>
> In C++ , I know how to create classes and objects
>
> In perl, how to create objects ..
> for example : I want to create a class in a module .. then use it by
> creating objects
>
> I hope you understand me :-)
Check the documentation that comes with Perl. perlobj, perltoot,
perltootc, perlboot....
--
David Wall
darkon@one.net
------------------------------
Date: 25 Sep 2001 13:32:30 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: OOP With perl
Message-Id: <m1vgi7m2ox.fsf@halfdome.holdit.com>
>>>>> "eDeveloper" == eDeveloper <webmaster@kwakeb.net> writes:
eDeveloper> Hi all
eDeveloper> I'm a c++ and perl developer
eDeveloper> I know that both of C++ and perl are support Objects
eDeveloper> In C++ , I know how to create classes and objects
eDeveloper> In perl, how to create objects ..
eDeveloper> for example : I want to create a class in a module .. then use it by
eDeveloper> creating objects
eDeveloper> I hope you understand me :-)
"perldoc perlboot", presuming you have a fairly modern Perl installed.
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
------------------------------
Date: Tue, 25 Sep 2001 15:25:08 -0500
From: Michael Carman <mjcarman@home.com>
Subject: Re: OOP With perl
Message-Id: <3BB0E824.5DB9821F@home.com>
eDeveloper wrote:
>
> In perl, how to create objects ..
> for example : I want to create a class in a module .. then use it by
> creating objects
This is all well covered in the documentation that you should already
have as part of your Perl installation. See the perltoot and perlobj
manpages. At a command prompt, type:
perldoc perltoot
perldoc perlobj
-mjc
------------------------------
Date: Tue, 25 Sep 2001 21:09:41 +0200
From: Dirk Munzinger <d_munzinger@yahoo.de>
Subject: Problem with Socket and sysread()
Message-Id: <3BB0D675.819B3462@yahoo.de>
Hi,
I am using a TCP-Socket-connection in a program and would like to read a
datastream with sysread() ($BUFSIZ is POSIX::BUFSIZ)
$rv = $src->sysread($data,$BUFSIZ,0);
This works fine in most cases but now I have found out that sometimes
not all the data gets read and that sometime the $BUSIZ is ignored. In
this case only a few bytes were read even if there where send more bytes
from the server.
Is there a problem with sysread (perl 5.6.1 on Linux) or is there a
better way to read data (binarydata) from a socket or can I check
somehow if all the data is read ?
Regards, Dirk
------------------------------
Date: 25 Sep 2001 18:54:05 +0100
From: nobull@mail.com
Subject: Re: quick regular expression question, please help!
Message-Id: <u9bsjzw402.fsf@wcl-l.bham.ac.uk>
"James Wexler" <jw005i@mail.rochester.edu> writes:
> Subject: quick regular expression question, please help!
Avoid exclamation marks and the phrases "quick question" and "please
help" in Usenet subject lines - they serve only to annoy people.
Use the space you save to actually put a real description of the
subject of your post in the subject line.
Eg.
Subject: Regular expression in a variable
(Still not accurate (see below) but several orders of magnitude better).
> hey all, im new to perl (about 2 hours)
You gotta be joking! 2 hours is like the minimum time you should
spend trying to solve any particular problem before post to Usenet.
> and i want to evaluate a regular expression
You do not evaluate regular expressions.
> kinda like "if( $l =~ s/^Desig:\s+// )" but the regular
> expression (that would be "s/^Desig:\s+//" is in a string, lets say $regex).
That is _not_ a regular expression - that is a sustitution operator
that deletes the part that matches the regex. It is only the bit
between the first // that is the regex. So I'm not going to call the
variable $regex I'm going to call it $subst. Also the string would
not be "s/^Desig:\s+//" it would be "s/^Desig:\\s+//" or
's/^Desig:\s+//' because the double-quotes already imply one level of
escape processing.
my $subst = "s/^Desig:\\s+//";
if( eval "\$l =~ $subst" ) {
eval() is evil and you should always try to avoid putting yourself in
a position where you want to use it. Can you explain why you think
you want to do this?
Perhaps CODErefs are what you are really looking for:
my $subst = sub { $_[0] =~ s/^Desig:\s+// };
if( $subst->($l) ) {
Perhaps you really did want just the regex in the varialble:
my $regex = qr/^Desig:\s+/;
if( $l =~ s/$regex// ) {
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Tue, 25 Sep 2001 15:52:29 -0400
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: setting error return values
Message-Id: <3BB0E07D.450FA156@earthlink.net>
perl misk wrote:
>
> when writing perl modules, how do you set return values and how do you
> set $! to be a meaningful message?
You have to set it to a numeric value, which in turn gets stored in the
C errno variable. Add a line "use Errno;" inside the module which you
want to be setting $!, and then use one of the symbolic constants.
You can't set it to a particular string though... it doesn't work that
way.
--
"I think not," said Descartes, and promptly disappeared.
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V10 Issue 1815
***************************************