[17256] in Perl-Users-Digest
Perl-Users Digest, Issue: 4678 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Oct 20 18:05:40 2000
Date: Fri, 20 Oct 2000 15:05:15 -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: <972079514-v9-i4678@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Fri, 20 Oct 2000 Volume: 9 Number: 4678
Today's topics:
Re: Encrypted file transfer slavinger@my-deja.com
Re: EOF character in middle of file? <mjcarman@home.com>
Re: finding mode and median of an array of numbers <lr@hpl.hp.com>
Re: Finding two words in any order in string? <lincmad001@telecom-digest.zzn.com>
Fork() with select()? eric@on-e.com
Re: Fork() with select()? <uri@sysarch.com>
Re: God, this is like hard work... <themoriman@ntlworld.com>
Re: God, this is like hard work... <themoriman@ntlworld.com>
Re: Going from Linux RPM Perl 5.00503 to compiled 5.6.0 (Andy Dougherty)
Help With Split... I think... :) <mezmoria@hotmail.com>
Help pape_98@my-deja.com
Re: Help pape_98@my-deja.com
Re: Help (Clay Irving)
Re: how can I get data from a file into variable? <lr@hpl.hp.com>
How good is DBM? <berube@odyssee.net>
Re: How good is DBM? <jeff@vpservices.com>
Re: How to find out the number of lines in a flat file. <gopalan@cs.sc.edu>
Re: How to find out the number of lines in a flat file. <lr@hpl.hp.com>
Re: lenght if query string <dsimonis@fiderus.com>
Looking For Ways To Branch To HTML Links <mmercurio88@my-deja.com>
Re: manipulating data files <jleffler@informix.com>
Re: need help with my script <pbarker@ntlworld.com>
Re: need help with my script <dsimonis@fiderus.com>
Re: need help with my script <sbearden@houston.rr.com>
Re: Need to change 3000 images... <speed.demon9999@virgin.net>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 20 Oct 2000 20:42:50 GMT
From: slavinger@my-deja.com
Subject: Re: Encrypted file transfer
Message-Id: <8sqao9$pou$1@nnrp1.deja.com>
slavinger@my-deja.com wrote:
> Hello,
>
> We're looking for a method of setting up encrypted link for
> transferring files in Perl. We need to do the following: a Unix
> client makes a request to a Win2k server (KDC) to generate a Kerberos
> keytab file for the client. Then the Win2k server pushes this file
> to the client. We would like to set up an encrypted channel for
> transferring this file. I looked around a bit and found some LWP
> modules that might work (like LWP::SecureSocket). The interface has
> to be supported on both sides: Win32 on one and Solaris/HP-UX/IRIX on
> the other. Does anyone have any particular module(s) recommendations?
>
Let me rephrase the above a bit... I'm looking for relatively strong
cryptographic modules (like DES/IDEA/etc.) that compile and work on all
major Unixes AND Win32. This encryption will be used for
socket-to-socket communication. Any recommendations?
Thanks.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Fri, 20 Oct 2000 14:05:20 -0500
From: Michael Carman <mjcarman@home.com>
Subject: Re: EOF character in middle of file?
Message-Id: <39F09770.A35A78C3@home.com>
p_erion@yahoo.com wrote:
>
> I'm having a bit of a problem reading the lines of a text file.
> Somehow there are some garbage characters in the file and one
> of them [\x1A or ^Z] seems to be interpreted as the EOF character
> [on a Windows machine]. At least, once that character is reached,
> reading stops, but I know more text follows.
Yep, it would do that.
> The contents of the test file is three lines long [with the
> "bad" character on the second line:
>
> A
> B
> C
>
> The hex values of that file being:
>
> 41 0D 0A 42 1A 0D 0A 43 0D 0A
>
> Is there someway that I can get around this eof character?
Yes, by using binmode:
#!/usr/local/bin/perl -w
use strict;
my $file = 'somefile.txt';
open(IN, $file) or die "Couldn't open '$file' [$!]\n";
binmode(IN);
while (<IN>) {
s/\015\012/\012/;
print ("$_");
}
print "\nCount: $.\n";
close(IN);
It prints:
A
B<^Z>
C
Count: 3
Okay, the ^Z won't actually print that way, but I didn't want to risk
hosing up anyone's newsfeed. Note that you'll have to deal with the CRLF
translation yourself, as well as decide what to do with the offensive
character.
> Disclaimer: I'm new to Perl so I may have missed something or be doing
> something incredibly stupid ...
Nope, I think you're in the clear on this one. :) ^Z shouldn't be
appearing in the middle of a text file.
-mjc
------------------------------
Date: Fri, 20 Oct 2000 11:55:16 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: finding mode and median of an array of numbers
Message-Id: <MPG.145a34f26f24cc3998ae4e@nntp.hpl.hp.com>
In article <52uvus4urg6dlfmujh9nti57se7n6mtvcm@4ax.com> on Fri, 20 Oct
2000 07:47:49 GMT, Bart Lateur <bart.lateur@skynet.be> says...
> Godzilla! wrote:
>
> >Alright, I'll level with you boys, this one time.
> >I did not 'get' those definitions anywhere. I made
> >them up.
>
> Gee. And all other docs I can find seem to (roughly) agree with your
> definition.
>
> Here's one example:
>
> http://library.thinkquest.org/17038/admission/math/meanmodemedian-question.html
>
> the mean is the average of a set of numbers; to calculate it, you take
> the sum of each of the terms in the set and then you divide that sum
> by the total number of items you have in your set.
No problem with that, except for a null set. :-)
> the mode is a number in a set that occurs most often.
The issue here is what is the mode if more than one value occurs 'most
often'. The reference you quote ignores that.
> the median is the middlemost number in a set of numbers if the set is
> arranged in order.
The issue here is what is the median if the cardinality of the set is
even. The reference you quote ignores that.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Fri, 20 Oct 2000 14:40:58 -0700
From: Linc Madison <lincmad001@telecom-digest.zzn.com>
Subject: Re: Finding two words in any order in string?
Message-Id: <201020001440587958%lincmad001@telecom-digest.zzn.com>
In article <39F02DF8.9C28EACD@ocegr.fr>, Stephane Barizien
<sba@ocegr.fr> wrote:
> nobull@mail.com wrote:
> >
> > Stephane Barizien <sba@ocegr.fr> writes:
> >
> > > I want to check if $str contains two (or more, but that's next) words,
> > > in any order...
> > >
> > > What's better than: foo.*bar|bar.*foo
> >
> > The best solution is two (or more) independent regexps.
> >
> > $str =~ /foo/ && $str =~ /bar/
> >
> > But if you _must_ do it with one:
> >
> > $str =~ /^(?=.*foo).*bar/
>
> That both works and needs heavy thinking to understand why (usual with
> Perl regexps... ;-)
The (?=.*foo) is a "zero-width lookahead assertion." That means that it
examines the string to see if the pattern .*foo follows the beginning
of the string (because of the ^), but it doesn't "consume" any of the
string in checking it. Thus, it will match ....foo....bar... and also
....bar....foo.... In either case, the lookahead matches the ".*foo"
and thus allows pattern-matching to continue; the pattern then matches
the ".*bar" starting from the beginning.
> What about extending to N (>2) words?
Either technique is directly extensible.
Incidentally, if you're really looking for words, you might want to
throw \b's around them so that you match "foo" but not "foolish."
------------------------------
Date: Fri, 20 Oct 2000 18:19:21 GMT
From: eric@on-e.com
Subject: Fork() with select()?
Message-Id: <J00I5.4279$_o5.21343@typhoon.san.rr.com>
Ok, here's the project specs: I need a small client/server operation that
can handle roughly 40-50 "operations" per second. (an operation consists
of X number of clients performing a function that takes about 2 secs to
complete with the data transfer about 80 bytes, so I figure I'll probably
have about 80-100 "clients" processing).
I've tried several different ways, including serial socket connections
(which yeilded about 5 operations/sec), and a forking server (which
yeilded about 7.5 o/s).
I'm thinking now that I'm going to need to pre-fork a certain number
of "servers" (let's say 20) so that each "server" can hopefully handle
roughly 4-5 clients. I've got a rough app written, but I seem to be
having problems with passing file handles (i.e. I can't get output to
the sockets):
#!/usr/bin/perl -w
use IO::Select;
use IO::Socket;
use IPC::ShareLite;
$MAX_SERVERS = 5;
$server = IO::Socket::INET->new( Proto =>
LocalPort => 9000,
Listen => 128, # SOMAXCONN
Reuse => 1);
die "can't setup server" unless $server;
print "[Server $0 accepting clients]\n";
$Servers = new IPC::ShareLite( -key => 5455, -create => 'yes', -destroy => 'no' ) or die $!;
$Connects = new IPC::ShareLite( -key => 1971, -create => 'yes', -destroy => 'no' ) or die $!;
$Servers->store(1);
$Connects->store(0);
$read_set = new IO::Select( $server );
while ( $Connects->fetch() < 10000 ) {
# get a set of readable handles (blocks until at least one handle is ready)
my $rh_set = IO::Select->select($read_set, undef, undef, 0);
# take all readable handles in turn
while( @rh_set = $read_set->can_read ) {
foreach my $rh (@rh_set) {
# if it is the main socket then we have an incoming connection and
# we should accept() it and then add the new socket to the $read_set
if ($rh == $server) {
$ns = $rh->accept();
$read_set->add($ns);
$rh->autoflush(1);
if ( $Servers->fetch() < $MAX_SERVERS ) {
$pid = fork();
die "Cannot fork: $!" unless defined($pid);
if ($pid == 0) {
ServeClient($rh);
}
} else {
ServeClient($rh);
}
} else {
# otherwise it is an ordinary socket and we should read and process the request
ServeClient($rh);
}
}
}
}
sub ServeClient {
my $client = shift;
my $Tmp = $Connects->fetch();
print $client "$Tmp";
close $client;
++$Tmp;
$Connects->store($Tmp);
print "Serving #$Tmp\n";
}
Can someone give me the once over and tell me if I'm completely off-base here?
Another thing I that I just considered is writing something in fast_cgi and running
enough copies against a pared down Apache server. Hmm.. =)
------------------------------
Date: Fri, 20 Oct 2000 18:31:07 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Fork() with select()?
Message-Id: <x77l73qs9g.fsf@home.sysarch.com>
>>>>> "e" == eric <eric@on-e.com> writes:
e> Ok, here's the project specs: I need a small client/server operation that
e> can handle roughly 40-50 "operations" per second. (an operation consists
e> of X number of clients performing a function that takes about 2 secs to
e> complete with the data transfer about 80 bytes, so I figure I'll probably
e> have about 80-100 "clients" processing).
use Event.pm. no forking needed for such a simple server.
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page ----------- http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net ---------- http://www.northernlight.com
------------------------------
Date: Fri, 20 Oct 2000 21:34:37 +0100
From: "The Moriman" <themoriman@ntlworld.com>
Subject: Re: God, this is like hard work...
Message-Id: <A%1I5.1452$Rk5.30511@news2-win.server.ntlworld.com>
Eric Bohlman <ebohlman@omsdev.com> wrote in message
news:8sppck$1lpp$3@news.enteract.com...
>Is it possible that the entries have trailing newlines?
Thanks Eric. That was exactly the problem. Bernard sorted the problem for
me, but I appreciate your help.
Thanks
Terry
------------------------------
Date: Fri, 20 Oct 2000 21:37:48 +0100
From: "The Moriman" <themoriman@ntlworld.com>
Subject: Re: God, this is like hard work...
Message-Id: <y22I5.1454$Rk5.30823@news2-win.server.ntlworld.com>
Gwyn Judd <tjla@guvfybir.qlaqaf.bet> wrote in message
news:slrn8v0nk0.7rg.tjla@thislove.dyndns.org...
> I was shocked! How could The Moriman <themoriman@ntlworld.com>
> say such a terrible thing:
Desperation :O) But I'm still here
> I think I know what you missed. Lemme guess:
>
> perldoc -f chomp
>
Bernard fixed the problem for me earlier. He gave me 2 choices.
i) search for "good old Bob\n" or
ii) as you rightly say use chomp on the input.
Thanks and appreciation
Terry
------------------------------
Date: Fri, 20 Oct 2000 19:01:42 -0000
From: doughera@maxwell.phys.lafayette.edu (Andy Dougherty)
Subject: Re: Going from Linux RPM Perl 5.00503 to compiled 5.6.0 - libraries are not in @INC now! Help!
Message-Id: <slrn8v15mh.5na.doughera@maxwell.phys.lafayette.edu>
>On Fri, 20 Oct 2000 01:04:52 +0200, Anders Lund <anders@wall.alweb.dk>
>wrote:
>I've often wondered if I should reinstall all my pods from cpan, etc.
>when I upgrade Perl as well so that they get put in the correct tree
>structure. (It would be nice if they were installed in a generic tree
>structure, rather than perl-version specific, if they can be used
>across perl versions).
>
>How do you Perl guru's deal with this?
See the section in the INSTALL file on "Coexistence with earlier
versions of perl5." It discusses this problem in considerable
detail. The default behavior is indeed to share what can be
safely shared across perl versions.
--
Andy Dougherty doughera@lafayette.edu
Dept. of Physics
Lafayette College, Easton PA 18042
------------------------------
Date: Wed, 18 Oct 2000 15:31:00 -0500
From: "TEst" <mezmoria@hotmail.com>
Subject: Help With Split... I think... :)
Message-Id: <8sl167$6ob@library2.airnews.net>
Ok, I admit it I suck as a programmer. I guess thats why I dont program full
time :). Anyway I need help from you experts out there.
I am trying to create an array from a line of text that has no formatting
and I cannot figure out how to seperate the fields.
Here is the original text.. (including spaces)
1111111111 00000011111110000001111111TEST COMPANY
11111111111636459802000101700
This is how I want it to look...
1111111111,0000001111111,0000001111111,TEST
COMPANY,11111111111,63645980,2000101700
Thank You Very Much..
Mez
PS... I am posting this to three perl groups cuz I am not sure which one is
correct for this type of question.......
------------------------------
Date: Fri, 20 Oct 2000 20:51:52 GMT
From: pape_98@my-deja.com
Subject: Help
Message-Id: <8sqb95$q7o$1@nnrp1.deja.com>
Hi all,
I have 2 questions.
The first:
I wrote a send mail script that almost works the way I want it.
#!/usr/local/bin/perl -w
use CGI qw(:standard);
sub email{
open (MAIL, "|mail tourep\@zeus.nhlbi.nih.gov");
print MAIL ("To the users of the Animal schedule list:\nDo not
forget to schedule the m$
close (MAIL);
}
@lines = "";
open(File, "/applications/apache/cgi-bin/animal-schedule-
list/animal.txt");
@lines = <File>;
close(File);
for ($i=0; $i <= $#lines; $i++) {
@names = split(/,/,$lines[$i]);
email ();
printf $names[2]
}
When I run this script, I get the email sent, but It doesn't return the
values inside $names[2]. when ever I run it I get a message saying the
$names[2] value is uninitialized.
Can you guys tell me what's wrong with my script.
My second question is, how do I get the script to run itself at a
particular date and time. The emails are to be sent out every week at 8
am. I have no clue as to how to go about doing that. Can you help me???
Thanks,
Pape
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Fri, 20 Oct 2000 21:02:40 GMT
From: pape_98@my-deja.com
Subject: Re: Help
Message-Id: <8sqbtc$qoq$1@nnrp1.deja.com>
In article <8sqb95$q7o$1@nnrp1.deja.com>,
pape_98@my-deja.com wrote:
> Hi all,
> I have 2 questions.
> The first:
> I wrote a send mail script that almost works the way I want it.
>
> #!/usr/local/bin/perl -w
> use CGI qw(:standard);
>
> sub email{
> open (MAIL, "|mail tourep\@zeus.nhlbi.nih.gov");
> print MAIL ("To the users of the Animal schedule list:\nDo not
> forget to schedule the m$
> close (MAIL);
> }
>
> @lines = "";
> open(File, "/applications/apache/cgi-bin/animal-schedule-
> list/animal.txt");
>
> @lines = <File>;
> close(File);
>
> for ($i=0; $i <= $#lines; $i++) {
> @names = split(/,/,$lines[$i]);
> email ();
> printf $names[2]
> }
>
> When I run this script, I get the email sent, but It doesn't return
the
> values inside $names[2]. when ever I run it I get a message saying the
> $names[2] value is uninitialized.
> Can you guys tell me what's wrong with my script.
OK, I figured this part out.
> My second question is, how do I get the script to run itself at a
> particular date and time. The emails are to be sent out every week at
>8 am. I have no clue as to how to go about doing that. Can you help
>me???
I still need help with this topic though.
Thanks
>
> Thanks,
> Pape
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 20 Oct 2000 21:17:05 GMT
From: clay@panix.com (Clay Irving)
Subject: Re: Help
Message-Id: <slrn8v1dih.3im.clay@panix3.panix.com>
On Fri, 20 Oct 2000 20:51:52 GMT, pape_98@my-deja.com <pape_98@my-deja.com>
wrote:
>I have 2 questions.
>The first:
>I wrote a send mail script that almost works the way I want it.
>
>#!/usr/local/bin/perl -w
>use CGI qw(:standard);
Why CGI? -- It isn't being used in your example.
>sub email{
> open (MAIL, "|mail tourep\@zeus.nhlbi.nih.gov");
open MAIL, "|mail tourep\@zeus.nhlbi.nih.gov" or die "$!\n";
> print MAIL ("To the users of the Animal schedule list:\nDo not
>forget to schedule the m$
This can't be right -- What's m$ and where is the closing ")
> close (MAIL);
>}
>
>@lines = "";
>open(File, "/applications/apache/cgi-bin/animal-schedule-
>list/animal.txt");
Test the open. Note: The usual convention is uppercase for filehandle
names.
>@lines = <File>;
>close(File);
>
>for ($i=0; $i <= $#lines; $i++) {
> @names = split(/,/,$lines[$i]);
> email ();
> printf $names[2]
>}
Why not just:
open FILE, "/applications/apache/cgi-bin/animal-schedule-list/animal.txt"
or die "$!\n";
while (<FILE>) {
chomp;
$name = (split /,/)[2];
print "$name\n";
}
There are a few other problems and potential problems:
- You don't pass any parameter to your email subroutine.
- Do you want to get the third element of @names
- Is the input file really a CSV file?
>When I run this script, I get the email sent, but It doesn't return the
>values inside $names[2]. when ever I run it I get a message saying the
>$names[2] value is uninitialized.
>Can you guys tell me what's wrong with my script.
You need to pass a parameter to your subroutine.
>My second question is, how do I get the script to run itself at a
>particular date and time. The emails are to be sent out every week at 8
>am. I have no clue as to how to go about doing that. Can you help me???
man crontab
--
Clay Irving <clay@panix.com>
Follow-ups to alt.nobody.really.cares
------------------------------
Date: Fri, 20 Oct 2000 14:12:19 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: how can I get data from a file into variable?
Message-Id: <MPG.145a550c705126d98ae50@nntp.hpl.hp.com>
In article <slrn8v06in.fji.mgjv@martien.heliotrope.home> on Fri, 20 Oct
2000 21:11:35 +1100, Martien Verbruggen <mgjv@tradingpost.com.au>
says...
...
> open(FILE, $file) or die "Cannot open $file: $!";
> my $line = (<FILE>)[-1];
> close FILE;
> chomp $line;
Compulsive use of chomp()!
> my $val = (split /\t/, $line)[-1];
>
> If the line is of intermediate length, and you have little memory:
>
> open(FILE, $file) or die "Cannot open $file: $!";
> my $line = (<FILE>)[-1];
> close FILE;
You inadvertantly copied the above two lines into this snippet.
> my $line;
> $line = $_ while <FILE>;
> chomp $line;
Compulsive use of chomp()!
> my $val = (split /\t/, $line)[-1];
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Fri, 20 Oct 2000 17:32:53 -0400
From: "Neb" <berube@odyssee.net>
Subject: How good is DBM?
Message-Id: <3P2I5.648$a8.14254@news.globetrotter.net>
hi,
I read in a book that DBM can do a quick job in writing and reading a
database in a flat file. Since I currently use flat file, this could be an
easy way to upgrade to a database? My database needs are really simple: a
list of members. Would there be a way to do a query in such a database?
For example, could I search in 10000 emails a particular one? Also, is the
database content all loaded in memory in such a database?
thanks,
neb
------------------------------
Date: Fri, 20 Oct 2000 14:43:33 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: How good is DBM?
Message-Id: <39F0BC85.8E0D5F00@vpservices.com>
Neb wrote:
>
> I read in a book that DBM can do a quick job in writing and reading a
> database in a flat file.
DBM has its own storage mechanisms. It does not store things in a flat
file (if by flat file you mean something that can be read by human
eyes).
> Since I currently use flat file, this could be an
> easy way to upgrade to a database?
A DBM is in some senses an upgrade from a flat file, but is not a real
database either. If your intention is to eventually use a real database
then your upgrade path is better to be straight to a real database or to
using your same flat files but accessed through DBI.
> My database needs are really simple: a
> list of members. Would there be a way to do a query in such a database?
Yes, using hashes and other perl structures you cook up yourself. There
is currently no DBI access to DBM so you can not use SQL queries on it
like you can on flat files.
> For example, could I search in 10000 emails a particular one? Also, is the
> database content all loaded in memory in such a database?
With either the DBI or DBM method, you can avoid loading the entire file
into memory, but with either one you can also mess up and load it all by
bad programming. It is up to you.
How many times do you need to ask this question? In the past three
weeks you have posted essentially this same question under four separate
subject headings. You have asked several different ways before and been
told that with a file of the size and complexity you are talking about
that DBM, DBI with flatfiles, flatfiles with plain Perl access are all
legitimate ways to go and you have been shown several examples of each.
Please make up your mind.
--
Jeff
------------------------------
Date: Fri, 20 Oct 2000 14:49:27 -0400
From: Gopi Sundaram <gopalan@cs.sc.edu>
Subject: Re: How to find out the number of lines in a flat file.....
Message-Id: <Pine.OSF.4.21.0010201448230.29469-100000@pearl.cs.sc.edu>
On 20 Oct 2000, Bernard El-Hagin wrote:
> perl -lpe '}$_=$.;{' <input file>
I, like many lurkers here I'm sure, have no idea have that line works.
Could someone please explain it in painstaking detail ?
Gopi.
--
Gopi Sundaram
gopi@cs.sc.edu
------------------------------
Date: Fri, 20 Oct 2000 12:33:17 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: How to find out the number of lines in a flat file.....
Message-Id: <MPG.145a3dd9f16b249898ae4f@nntp.hpl.hp.com>
In article <Pine.OSF.4.21.0010201448230.29469-100000@pearl.cs.sc.edu> on
Fri, 20 Oct 2000 14:49:27 -0400, Gopi Sundaram <gopalan@cs.sc.edu>
says...
> On 20 Oct 2000, Bernard El-Hagin wrote:
>
> > perl -lpe '}$_=$.;{' <input file>
>
> I, like many lurkers here I'm sure, have no idea have that line works.
> Could someone please explain it in painstaking detail ?
In order to understand this, you need merely to look at perlrun under
the '-p' option, and take quite literally the line with the comment
"your program goes here".
You can find the description of $. in perlvar.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Fri, 20 Oct 2000 14:23:34 -0400
From: Drew Simonis <dsimonis@fiderus.com>
Subject: Re: lenght if query string
Message-Id: <39F08DA6.7F759549@fiderus.com>
Stefan Glimne wrote:
>
> Hi all,
>
> Does anyone know how long the "query string" can be. I have problem when
> I write to much in a TEXTAREA. The "query string" is just cut. Is there
> a solution for this problem. Should I perhaps use another
> cgi-translator?
>
Use CGI.pm
------------------------------
Date: Fri, 20 Oct 2000 18:55:36 GMT
From: Mike Mercurio <mmercurio88@my-deja.com>
Subject: Looking For Ways To Branch To HTML Links
Message-Id: <8sq4f3$k19$1@nnrp1.deja.com>
Hi,
I'm new to Perl. I'm looking for a way for a Perl script to:
1) Spin through links of a given HTML page.
2) When I hit certain links, I want to follow that link to the new page.
3) When I get to the new page, I want to save the page to my hard drive.
4) After I save it, I want to return to the original page.
(...then repeat the process)
Are there modules written to do this? If so, what ones are they and
where can I get them? Any extra hints on how to do each of these steps
(like what methods to use, etc.) are greatly appreciated!!!
Thank you.
Mike
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Fri, 20 Oct 2000 11:02:04 -0700
From: Jonathan Leffler <jleffler@informix.com>
Subject: Re: manipulating data files
Message-Id: <39F0889C.EC91BFAF@informix.com>
triggerfish2001@hotmail.com wrote:
> I have just basic knowledge of perl. The task I need to accomplish is as
> follows:
>
> source file needs to be converted to target file.
> source file will be a fixed column length ASCII file of data.
> target file will be a PIPE ('|') seperated ASCII file of data.
>
> For eg:-
> source file will be as follows:
>
> John Smith 745-678-089011-10-1955
> Robert IhaveAlongName345-567-453219-04-1967
>
> Here the first 22 char is fixed length for name
> Starting from 23rd char next 12 char is for SSN
> Starting from 35th char next 10 char is for DOB.
>
> Now this needs to be changed to
> John Smith|745-678-0890|11-10-1955|
> Robert IhaveAlongName|345-567-4532|19-04-1967|
>
> The reason for this is that informix dbload or high performance loader needs
> a field delimiter.
DB-Load accepts fixed format input without delimiters - RTFM.
You could also get DBLDFMT from the IIUG software archive. This can do
a number of transformations on the fixed-width data which DB-Load cannot
(such as insert explicit decimal points when the data only has implicit
decimal points, and add literal values or combine compound sets of
columns with literals). And SQLCMD (also from the IIUG) allows you to
avoid creating an intermediate file (target file) -- you can run the
output of the transformer directly into "sqlreload -d dbase -t table".
Hannes Visagie suggested a way to do it with a shell script. It would
more
or less work (the '| tee dest_file.unl' as written would clobber the
output file on
every row and should be moved outside the loop, after the 'done'), but
would
be very slow.
> How can this be achieved in perl.
TMTOWTDI - there's more than one way to do it.
Using unpack is an option. A regex with counted patterns would be
another.
--
Yours,
Jonathan Leffler (Jonathan.Leffler@Informix.com) #include <disclaimer.h>
Guardian of DBD::Informix v1.00.PC1 -- http://www.perl.com/CPAN
"I don't suffer from insanity; I enjoy every minute of it!"
------------------------------
Date: Fri, 20 Oct 2000 20:11:22 +0100
From: "Paul Barker" <pbarker@ntlworld.com>
Subject: Re: need help with my script
Message-Id: <xL0I5.1140$bL1.29564@news6-win.server.ntlworld.com>
Perhaps if you said what the problem is ?
;-)
PaulB
"Seth" <sbearden@houston.rr.com> wrote in message
news:Cj%H5.9688$Fe4.251301@typhoon.austin.rr.com...
> ftp.fragilis.net/pub/newnewlpbmatches.cgi
> coudl someone please look at this and maybe tell me what im doing wrong?
>
>
------------------------------
Date: Fri, 20 Oct 2000 14:37:01 -0400
From: Drew Simonis <dsimonis@fiderus.com>
Subject: Re: need help with my script
Message-Id: <39F090CD.CF9A52D7@fiderus.com>
Seth wrote:
>
> ftp.fragilis.net/pub/newnewlpbmatches.cgi
> coudl someone please look at this and maybe tell me what im doing wrong?
Why would anyone want to help you if you don't want to
help yourself?
You script starts with:
#!/usr/bin/perl
No warnings? Where's strict? You aren't using the builtins
that are there to help you. Do so and you'll likely see the
problem. If you still need help, then post, and lots of folks
will help.
------------------------------
Date: Fri, 20 Oct 2000 21:28:46 GMT
From: "Seth" <sbearden@houston.rr.com>
Subject: Re: need help with my script
Message-Id: <iO2I5.13615$P14.302635@typhoon.austin.rr.com>
I got it fixed, thanks for help though.
"Seth" <sbearden@houston.rr.com> wrote in message
news:Cj%H5.9688$Fe4.251301@typhoon.austin.rr.com...
> ftp.fragilis.net/pub/newnewlpbmatches.cgi
> coudl someone please look at this and maybe tell me what im doing wrong?
>
>
------------------------------
Date: Fri, 20 Oct 2000 19:58:23 +0100
From: "Speed Demon" <speed.demon9999@virgin.net>
Subject: Re: Need to change 3000 images...
Message-Id: <8sq4i4$ilt$1@uk25.supernews.com>
Hi, yes I did a search but was unsure what to look for. Thanks for the
module, i'll look into it.
--------------------------------------------------------
http://www.e-tones.co.uk
Free Resources For Your Mobile Phone
"Anders Lund" <anders@wall.alweb.dk> wrote in message
news:lD%H5.7559$Uy5.272378@news000.worldonline.dk...
> Speed Demon wrote:
>
> > Hi everyone, I've got a little problem with some images on my site.
> >
> > I have 3000 of them, I need them all to be 72x14, some are not, a few
are
> > a few pixels out.
> > Using perl or other language, can I read in the image, check out its
size
> > and delete the strip of offending pixels if necessary and then save the
> > image again?
> >
> > I wouldn't mind doing this manually if it wasn't for the huge number of
> > pictures :)
> >
> > Any ideas? Will I need to get some modules installed to do this?
> >
> > thanks for your help, best regards Taz.
>
> Image::Magick may do the job
>
> Did you visit http://search.cpan.org before asking such a basic q??
>
> -anders
>
> --
> [ the word wall - and the trailing dot - in my email address
> is my _fire_wall - protecting me from the criminals abusing usenet]
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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 V9 Issue 4678
**************************************