[22769] in Perl-Users-Digest
Perl-Users Digest, Issue: 4990 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri May 16 03:05:49 2003
Date: Fri, 16 May 2003 00:05:21 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Fri, 16 May 2003 Volume: 10 Number: 4990
Today's topics:
Re: @Array - making it null <bigj@kamelfreund.de>
Re: [The/My] trouble with Perl <abigail@abigail.nl>
Re: [The/My] trouble with Perl <henq _ replace 0 by o <hvtijen@h0tmail.c0m>>
change a format patern <member17678@dbforums.com>
finding out array size <sav_me_to_nospam@hotmail.com>
Re: finding out array size <mbudash@sonic.net>
Re: finding out array size <grazz@pobox.com>
full 256 ascii auto string increment? <no.spam@spam.com>
Help!: Hash or Array in this Situation? (entropy123)
Re: HTTP POST & authorization <mbudash@sonic.net>
Re: HTTP POST & authorization <w.koenig@acm.org>
Re: I know it is a newbie dumb question but the answer <jurgenex@hotmail.com>
Image::Size problem under Win 98 <dropallx_webmasterx@xmbstevens.comx>
Re: Image::Size problem under Win 98 (Jay Tilton)
Re: measuring web resource loading time <pigmalion@bigfoot.com>
my and dereferences (T. Postel)
Re: MYSQL images <musicman@hotmail.com>
NEWBIE match string in list <"goodrow"@opencity. com>
Re: NEWBIE match string in list <tassilo.parseval@rwth-aachen.de>
Re: NEWBIE match string in list <karabot@canada.com>
Re: No data entering @array from open(DATA...) <REMOVEsdnCAPS@comcast.net>
Re: ordering an excel spreadsheet with perl (Jay Tilton)
Re: Perl, Xcopy on Windows, printing out results as we (Jim B)
printing output from two files using hash (Faz)
Re: printing output from two files using hash (Philip Lees)
Re: problem with starting path (Jay Tilton)
Re: Re: Image::Size problem under Win 98 <dropallx_webmasterx@xmbstevens.comx>
Re: Sorting $array[0] <w.koenig@acm.org>
starting an instance of browser with web forms filled i (job)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 15 May 2003 21:39:26 +0200
From: "Janek Schleicher" <bigj@kamelfreund.de>
Subject: Re: @Array - making it null
Message-Id: <pan.2003.05.15.19.39.23.986135@kamelfreund.de>
Balaji Venkataraman wrote at Mon, 12 May 2003 18:52:18 -0700:
> I've see people do this to read the whole file in one fell swoop:
>
> Code 1
> ------
> local $/ = undef;
> while (<>) {
> $file_text = $_;
> }
local $/ = undef; # I really write, just to underline what I want
$file_text = <>;
has the advantage of being quick,
Disadvantages are that it is hard to read
(especially for beginners)
and that you have to take care about the scope of the changed $/.
> Code 2
> ------
> while (<>) {
> $file_text = join ("", $_);
> }
$file_text = join "", (<>);
has the advantage that you need less to type (in a 1-4 liner the most
important fact :-)) and it is easier to understand, even from beginners.
Of course, it's slower.
I also could never decide
what of the both ways I prefer.
Nowadays I use the most readable, still quick way,
of course only there where I know the filename.
use File::Slurp;
my $file_text = read_file($filename);
Otherwise in 1-4 liners where only the speed of typing matters,
I prefer Code 2, and when I really want the features of <>,
I use in longer scripts Code 1 (most with a little comment, or an
obviously block scheme).
Cheerio,
Janek
------------------------------
Date: 15 May 2003 23:05:00 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: [The/My] trouble with Perl
Message-Id: <slrnbc878s.mth.abigail@alexandra.abigail.nl>
Henk van Bree (geenspam@geenspam.biz) wrote on MMMDXLIV September
MCMXCIII in <URL:news:3ec3e567$0$49104$e4fe514c@news.xs4all.nl>:
:) Abigail wrote:
:) > I'm confused. You make an application, and as part of the application
:) > it's ok to include Tk, which has a buttload of files, but it's not ok
:) > to roll out Perl, which is also just a buttload of files?
:)
:) That's the short version of it, yes. The application will be deployed
:) in several financial institutions (banking and insurance) and one of
:) the requirements is that there can be no (as in none whatsoever)
:) development tools on the client machines. Combined with other rather
:) stringent security measures this will ensure no-one tampers with
:) the programs and datasets.
Well, can Perl be on the client machine? If it can, you can deploy it
as part of the application. If it cannot, this entire exercise is
academic, isn't?
Abigail
--
print 74.117.115.116.32;
print 97.110.111.116.104.101.114.32;
print 80.101.114.108.32;
print 72.97.99.107.101.114.10;
------------------------------
Date: Fri, 16 May 2003 01:49:15 +0200
From: "henq" <henq _ replace 0 by o <hvtijen@h0tmail.c0m>>
Subject: Re: [The/My] trouble with Perl
Message-Id: <3ec4277d$0$76746$1b62eedf@news.wanadoo.nl>
I use GhostScript as an alternative to GD. Gives you cleaner graphics with
anti-aliasing and more effects, like scaling and rotation. As GhostScript
installs with its own fonts, it usually runs with 1 install. The postscript
language takes some time to grok, however.
~henk (too :-)
"Henk van Bree" <geenspam@geenspam.biz> wrote in
news:3ec28f75$0$49117$e4fe514c@news.xs4all.nl...
>
> **Let Perl 7 have a native GUI widget set!**
>
> I need to draw a weird type of graph, so I tried to install Graph.pm.
> This didn't go well, because it needed another version of GD.pm.
> This didn't go well, because it needed another version of libgd.
> This didn't go well, because it didn't like my version of freetype...
>
------------------------------
Date: Fri, 16 May 2003 00:15:59 +0000
From: Mario542 <member17678@dbforums.com>
Subject: change a format patern
Message-Id: <2885089.1053044159@dbforums.com>
Does anyone know how to change the format pattern of a query from a perl
script? When I run the perl script it returns the total amout of
3642.0500 from the database. What I am tring to do is change it to
3,642.05 without the extra zeros so it looks better for the user.
Thanks for all the help,
Mario
--
Posted via http://dbforums.com
------------------------------
Date: Fri, 16 May 2003 12:30:49 +1000
From: "leeper" <sav_me_to_nospam@hotmail.com>
Subject: finding out array size
Message-Id: <ba1ikk$omh$1@perki.connect.com.au>
If I had the number of bytes (ie. 7375765348000) and want to break it up
with commas, how do I find out the elements size
------------------------------
Date: Fri, 16 May 2003 02:49:28 GMT
From: Michael Budash <mbudash@sonic.net>
Subject: Re: finding out array size
Message-Id: <mbudash-69BE2D.19492815052003@typhoon.sonic.net>
In article <ba1ikk$omh$1@perki.connect.com.au>,
"leeper" <sav_me_to_nospam@hotmail.com> wrote:
> If I had the number of bytes (ie. 7375765348000) and want to break it up
> with commas, how do I find out the elements size
>
>
???
what's this got to do with your post's subject (array size)??
or are you wanting to get this: 7,375,765,348,000 ?? if so:
perldoc -q "numbers with commas added"
- or this is fun -
$_ = 7375765348000;
($temp = reverse $_) =~ s/(...)/$1,/g;
($_ = reverse $temp) =~ s/^,//;
print "$_\n";
hth-
--
Michael Budash
------------------------------
Date: Fri, 16 May 2003 02:52:28 GMT
From: Steve Grazzini <grazz@pobox.com>
Subject: Re: finding out array size
Message-Id: <MnYwa.30325$h42.11698@twister.nyc.rr.com>
leeper <sav_me_to_nospam@hotmail.com> wrote:
> If I had the number of bytes (ie. 7375765348000) and want
> to break it up with commas, how do I find out the elements size
There's an FAQ on commifying numbers:
$ perldoc -q 'with commas'
But maybe you'd better give an example of the format you want.
--
Steve
------------------------------
Date: Thu, 15 May 2003 22:59:16 -0700
From: "LBX10" <no.spam@spam.com>
Subject: full 256 ascii auto string increment?
Message-Id: <ba1uqo$nmv$1@news.astound.net>
What is the best way to go about incrementing a string so as to use all 256
chars (ASCII) instead of just [A-Za-z0-9] ?
So I can cycle al the way from \0x00 all the way to
\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF
(that is, those hex values are really characters just not printable ones but
define the full range.)
Thanks
--
LBX10
------------------------------
Date: 15 May 2003 20:26:39 -0700
From: email_entropy123@yahoo.com (entropy123)
Subject: Help!: Hash or Array in this Situation?
Message-Id: <90cdce37.0305151926.6fc3bbfc@posting.google.com>
Hey all,
Special thanks to Sam Holden, whose code looks good but I can't seem
to get to the point where I can make use of it....Soon...Soon...
Anyway I'm still trying to perform a Depth First Search to determine
which atoms (nodes) are part of a ring structure....and I want to save
those nodes for later reference.
I'm starting to generate many arrays...see '@$angel' below and am
having difficulty keeping good track.
Any suggestions as to good bookeeping? I'm thinking I need to generate
a list of arrays to iterate - push through a compare subroutine -
through and compare each array to every other array (not too good with
the logical statements yet...)
My array names are something like name123 name122 name231 and so
on...its very hard to keep track... :) At least I figured out how to
make arrays on the fly...
Thanks!
entropy
foreach $first ( keys %supha ) { #takes key and assigns it a $first
$through =0;
for $second ( keys %{ $supha{$first} } ) { #iterates through each
value
$through += 1;
$pass =0;
for $third ( keys %{ $supha{$second} } ) { #goes to atom connected
to second
$pass +=1;
$pass2 =0;
if ($third ne $first) { #checks to see if third atom is first
for $four ( keys %{ $supha{$third} } ) {
$pass2 +=1;
if ($four ne $second) {
print "\nf: $first, s:$second t:$third, fo: $four\n";
$angel = $first . $through . $pass . $pass2;
# print "angel: $angel\n";
push (@{ $angel}, $first);
push (@{ $angel}, $second);
push (@{ $angel}, $third);
push (@{ $angel}, $four);
#my %remem;
#my ( $first, @memory ) = split; # Split $_ on white space
#push @{ $remem{ $first}}, @memory; # Just push, it'll spring
into existence
print "$first-$through-$pass-$pass2: @$angel\n";
#@memory=();
#push (%memory{$first}, $second);
#push (%memory{$first}, $third);
#push (%memory{$first}, $fourth);
}
}
}
}
}
}
------------------------------
Date: Fri, 16 May 2003 02:10:33 GMT
From: Michael Budash <mbudash@sonic.net>
Subject: Re: HTTP POST & authorization
Message-Id: <mbudash-2E2D3E.19103215052003@typhoon.sonic.net>
In article <b84a29a9.0305151327.544a632d@posting.google.com>,
alexander.klosch@web.de (Alexander Klosch) wrote:
> hi,
> this scrpit should connect to another script, authenticate at the
> server and give back the response. without authentication (disabled
> .htaccess) it works.
> when .htaccess is enabled i get following error code:
>
> 400 (Bad Request) URL must be absolute
>
> but imho I'm using an absolute URI. what am I doin wrong?
>
> thanx alot for help!
> kloschi
>
> #!/usr/bin/perl
> use LWP;
> use HTTP::Request::Common;
> use HTTP::Response;
> use MIME::Base64;
> $ua = LWP::UserAgent->new;
> $method = "POST => 'http://domain.tld/cgi-bin/testin.pl'";
> $uri = "'http://domain.tld/cgi-bin/testin.pl'";
> $user = "user";
> $pass = "pasword";
> $encoded = encode_base64('$user:$pass');
> $head = HTTP::Headers->new([authorization_basic => '$encoded']);
> $content = "Content => [
> TYPE => 'ALPHANUM',
> TEXT => 'testtext',
> ]";
> $request = HTTP::Request->new($method, $uri, $head, $content);
> $response = $ua->request($request);
> if ($response->is_success) {
> print $response->content;
> } else {
> print $response->error_as_HTML;
> };
perldoc lwpcook
scan for 'ACCESS TO PROTECTED DOCUMENTS'
hth-
--
Michael Budash
------------------------------
Date: Fri, 16 May 2003 04:58:13 +0200
From: Winfried Koenig <w.koenig@acm.org>
Subject: Re: HTTP POST & authorization
Message-Id: <3EC453C5.70001@acm.org>
Alexander Klosch wrote:
> hi,
> this scrpit should connect to another script, authenticate at the
> server and give back the response. without authentication (disabled
> .htaccess) it works.
> when .htaccess is enabled i get following error code:
>
> 400 (Bad Request) URL must be absolute
>
> but imho I'm using an absolute URI. what am I doin wrong?
>
> thanx alot for help!
> kloschi
>
> #!/usr/bin/perl
> use LWP;
> use HTTP::Request::Common;
> use HTTP::Response;
> use MIME::Base64;
> $ua = LWP::UserAgent->new;
> $method = "POST => 'http://domain.tld/cgi-bin/testin.pl'";
> $uri = "'http://domain.tld/cgi-bin/testin.pl'";
> $user = "user";
> $pass = "pasword";
> $encoded = encode_base64('$user:$pass');
> $head = HTTP::Headers->new([authorization_basic => '$encoded']);
> $content = "Content => [
> TYPE => 'ALPHANUM',
> TEXT => 'testtext',
> ]";
> $request = HTTP::Request->new($method, $uri, $head, $content);
> $response = $ua->request($request);
> if ($response->is_success) {
> print $response->content;
> } else {
> print $response->error_as_HTML;
> };
from 'perldoc HTTP::Request':
| $r = HTTP::Request->new($method, $uri, $header, $content)
| Constructs a new "HTTP::Request" object describing a
| request on the object $uri using method $method. The
| $uri argument can be either a string, or a reference
| to a "URI" object. The optional $header argument
| should be a reference to an "HTTP::Headers" object.
| The optional $content argument should be a string.
The string $method must be one of "GET", "POST", "HEAD" ...
and not "POST => 'http://domain.tld/cgi-bin/testin.pl'".
The string $uri must start with a known scheme like "http"
and not "'http". The unknown scheme (with first character "'")
forces LWP::UserAgent to generate the error 400.
Winfried
------------------------------
Date: Thu, 15 May 2003 22:13:43 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: I know it is a newbie dumb question but the answer is not in the camel
Message-Id: <riUwa.26310$Ur1.5109@nwrddc03.gnilink.net>
Bob wrote:
> looked for it every where . . .
>
> why does perl use "=~" for s/// and tr///
> and not just a straight "=' for assign ?
I think you are a bit confused.
Neither s/// nor tr//// 'use' the "=~".
The "=~" is the binding operator and if used in conjunction with s/// or
tr/// it tells those operators to use the indicated variable as the
_INPUT_value(!) of the operation instead of $_.
The assignment operator "=" on the other hand (which you can use in addition
to or instead of "=~") indicates what to do with the _OUTPUT_ value or
result of the operation.
Two totally different and totally unrelated functions.
jue
------------------------------
Date: Fri, 16 May 2003 04:02:57 GMT
From: m <dropallx_webmasterx@xmbstevens.comx>
Subject: Image::Size problem under Win 98
Message-Id: <4bv8cv824bgdlqqft8m42u4hev4muo933u@4ax.com>
#!C:/Perl/bin/perl.exe
use Image::Size ':all';
my ($w,$h,$t) =
imgsize("Gopen.jpg") ||
warn("\nERR: imgsize() call\n");
print "\nimgsize() results: $w,$h,$t\n";
my @a =
attr_imgsize( "Gopen.jpg" ) ||
warn("\nERR: attr_imgsize() call\n");
print "attr_imgsize() results: $a[0],$a[1],$a[2],$a[3]";
my $s=
html_imgsize("Gopen.jpg") ||
warn("\nERR: html_imgsize() call\n");
print "\nhtml_imgsize() results: $s \n";
print "\nOK\n";
my $x;
$x =<>; #just to keep test window open
____________________________________
This little test program, running under
Win 98, prints:
____________________________________
ERR: imgsize() call
imgsize() results: 1,,
attr_imgsize() results: 326,,,
html_imgsize() results: width="441" height="326"
OK
____________________________________
So only html_imgsize() works correctly.
What's going on? Is there some bug in
the Image::Size module under Win 98, or
am I just programming from the elbows down?
TIA,
m
------------------------------
Date: Fri, 16 May 2003 05:27:10 GMT
From: tiltonj@erols.com (Jay Tilton)
Subject: Re: Image::Size problem under Win 98
Message-Id: <3ec472b7.245647132@news.erols.com>
m <dropallx_webmasterx@xmbstevens.comx> wrote:
: #!C:/Perl/bin/perl.exe
: use Image::Size ':all';
:
: my ($w,$h,$t) =
: imgsize("Gopen.jpg") ||
: warn("\nERR: imgsize() call\n");
: print "\nimgsize() results: $w,$h,$t\n";
:
: my @a =
: attr_imgsize( "Gopen.jpg" ) ||
: warn("\nERR: attr_imgsize() call\n");
: print "attr_imgsize() results: $a[0],$a[1],$a[2],$a[3]";
:
: my $s=
: html_imgsize("Gopen.jpg") ||
: warn("\nERR: html_imgsize() call\n");
: print "\nhtml_imgsize() results: $s \n";
: print "\nOK\n";
:
: my $x;
: $x =<>; #just to keep test window open
: ____________________________________
:
:
: This little test program, running under
: Win 98, prints:
: ____________________________________
: ERR: imgsize() call
:
: imgsize() results: 1,,
: attr_imgsize() results: 326,,,
: html_imgsize() results: width="441" height="326"
:
: OK
: ____________________________________
:
: So only html_imgsize() works correctly.
: What's going on? Is there some bug in
: the Image::Size module under Win 98, or
: am I just programming from the elbows down?
It's a matter of context. If you write, e.g.,
my @values = foo('something') || warn('Yipe!');
since || has higher precedence than assignment, foo() gets called in
scalar context.
According to the Image::Size documentation, an undef value in the
first element of the return list indicates an error. You might change
your code to resemble (untested),
( my($w,$h,$t) = imgsize("Gopen.jpg") )[0] || warn(...);
------------------------------
Date: Fri, 16 May 2003 05:43:02 +0100
From: pigmalion <pigmalion@bigfoot.com>
Subject: Re: measuring web resource loading time
Message-Id: <bpq8cvkph7rqccvoa81dilbbet4lpk4eg6@4ax.com>
On Thu, 15 May 2003 09:32:18 +0100, pigmalion <pigmalion@bigfoot.com>
wrote:
>On 14 May 2003 06:17:19 -0700, jrolandumuc@yahoo.com (JR) wrote:
>
>>perldoc -f time
>
>Many thanks both of you.
but... i've been able to use the module in windows without installing
it, just putting all the files in a dir called Time and path added.
I can't do the same on linux, the module says it can't load
appropriate object for hires.pm
I guess it looks for the file .so that comes with the module!
Any suggestion?
I'd like to use hires on linux without formal installation.
I would like to be as much indipendent as i can from the isp and their
modules package.
Thx in advance for any suggestion.
--
www.pigmalion.info
www.pigmalion.info/perl/
------------------------------
Date: Fri, 16 May 2003 06:44:42 GMT
From: T.Postel@ieee.org (T. Postel)
Subject: my and dereferences
Message-Id: <uN%wa.116$rO.17283@newsread1.prod.itd.earthlink.net>
Can someone explain this to me:
@one = (0, 1);
my @two = (4, 5);
my $test1 = 'one';
my $test2 = 'two';
print "@$test1 \n@$test2\n$]";
shows this:
Name "main::one" used only once: possible typo at one.pl line 2.
0 1
5.00503
--
While my e-mail address is not munged, | T.Postel@ieee.org
I probably won't read anything sent there. |
------------------------------
Date: Fri, 16 May 2003 06:53:27 +0200
From: Music Man <musicman@hotmail.com>
Subject: Re: MYSQL images
Message-Id: <MPG.192e8d336570963398970b@news.siol.net>
In article <u93cjhjwy4.fsf@wcl-l.bham.ac.uk>, nobull@mail.com says...
> Music Man <musicman@hotmail.com> writes:
>
> > In article <3EC1F118.8060401@bbsrc.ac.uk>, simon.andrews@bbsrc.ac.uk
> > says...
> > > Do you really need to store the images in the
> > > database itself. This gives you the overhead of retrieving them and
> > > outputting them with a CGI script each time. When I've needed to do
> > > this before I usually store the images on disk, and store their location
> > > in the database. That way I can add the real image location into the
> > > first dynamically generated web page and save myself the extra overhead
> > > of a separate CGI call for each image.
> >
> > Yes, because of the security reasons. You have control over which image
> > can be shown. If you have only locations of the images stored in a
> > database, than anyone who can guess filename, can actually see it.
>
> Anyone who can guess the HTTP request needed to retrieve the image can
> see it. This is inpedendant of how the image is stored. I also has
> nothing to do with Perl.
>
>
Not true. If you have pics stored in a database, a CGI script has a
control over it, so it can choose whether to show it or not using
different security approaches (WEB server login, login with cookies
etc...).
------------------------------
Date: Fri, 16 May 2003 00:40:35 -0400
From: Jason Goodrow <"goodrow"@opencity. com>
Subject: NEWBIE match string in list
Message-Id: <ba1pev$60f$1@reader1.panix.com>
Hello and thanks,
I want to text match a string against a list
if($var eq ("this" or "that" or "another")) {
print "yes";
}
Which (of course) doesn't work.
Thanks for any info
jg@open%asfh%city.com
------------------------------
Date: 16 May 2003 04:54:33 GMT
From: "Tassilo v. Parseval" <tassilo.parseval@rwth-aachen.de>
Subject: Re: NEWBIE match string in list
Message-Id: <ba1qu9$mta$1@nets3.rz.RWTH-Aachen.DE>
Also sprach Jason Goodrow:
> I want to text match a string against a list
>
> if($var eq ("this" or "that" or "another")) {
> print "yes";
> }
>
> Which (of course) doesn't work.
You could use Quantum::Superpositions:
use Quantum::Superpositions;
if ($var eq any(qw(this that another))) {
print "yes";
}
A more traditional approach could involve a regex:
my @list = qw(this that another);
if ($var =~ /(??{ join '|', map { "^$_\$" } @list })/) {
print "yes";
}
The above dynamically turns @list into a suitable regular expression.
The pattern to match $var against will look like
/^this$|^that$|^another$/
for this case.
Tassilo
--
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval
------------------------------
Date: Fri, 16 May 2003 00:45:48 -0400
From: "George Karabotsos" <karabot@canada.com>
Subject: Re: NEWBIE match string in list
Message-Id: <02_wa.5146$z13.717480@news20.bellglobal.com>
You should be able to do it with the grep function, but if I was you I will
use foreach to loop around your values and test inside the loop for
equality, once I get one match I print "yes" and break out of the loop.
"Jason Goodrow" <"goodrow"@opencity. com> wrote in message
news:ba1pev$60f$1@reader1.panix.com...
> Hello and thanks,
>
> I want to text match a string against a list
>
> if($var eq ("this" or "that" or "another")) {
> print "yes";
> }
>
> Which (of course) doesn't work.
> Thanks for any info
>
> jg@open%asfh%city.com
>
------------------------------
Date: Thu, 15 May 2003 20:26:50 -0500
From: "Eric J. Roode" <REMOVEsdnCAPS@comcast.net>
Subject: Re: No data entering @array from open(DATA...)
Message-Id: <Xns937CDA2D484A9sdn.comcast@216.166.71.239>
-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1
Dodger <dodger@dodger.org> wrote in
news:Xns937C6F7ED8FA8dodgerdodgerorg@216.166.71.239:
> Of course, if you want to chomp the lines then that won't work, and
> the normal way to do it is with the while loop. Or you could just do
> this:
>
> my @currplids = map {chomp; $_} (<CPDATA>);
chomp (my @currplids = <CPDATA>);
- --
Eric
print scalar reverse sort qw p ekca lre reh
ts uJ p, $/.r, map $_.$", qw e p h tona e;
-----BEGIN xxx SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>
iQA/AwUBPsQ+UmPeouIeTNHoEQL5LwCg7+X0+QSY5SUy1lYHYUCRpX81otwAoKZ5
sw3t4OE7DjYSnOKQfxs7AOmb
=XDll
-----END PGP SIGNATURE-----
------------------------------
Date: Fri, 16 May 2003 01:29:19 GMT
From: tiltonj@erols.com (Jay Tilton)
Subject: Re: ordering an excel spreadsheet with perl
Message-Id: <3ec43e57.232237418@news.erols.com>
rory@vivid-design.com.au (Rory) wrote:
: I would like to know how to order the information in an excel file
: using perl, if this is possible. I am currently using
: Spreadsheet::ParseExcel to retrieve the information from excel.
What do you mean by "order?"
The choice of tool depends on what you want to do, but it's not clear
what you want.
You could manipulate the spreadsheet directly with Win32::OLE.
You could invoke a preexisting VBA macro with perl.
You could make the spreadsheet an ODBC data source and do all the work
with DBI.
Or Spreadsheet::ParseExcel may be perfectly adequate.
Directly answering the question asked, yes, it's possible.
------------------------------
Date: 15 May 2003 20:51:46 -0700
From: jigidyjim@aol.com (Jim B)
Subject: Re: Perl, Xcopy on Windows, printing out results as we go
Message-Id: <457dade9.0305151951.403081e5@posting.google.com>
Darren Dunham <ddunham@redwood.taos.com> wrote in message news:<QRwwa.951$Ec2.82521290@newssvr21.news.prodigy.com>...
> Can you trim your script to just this one line and see if the same thing
> happens? It sounds like STDOUT buffering, but that won't normally
> happen with a system() like this, since perl isn't handling the output.
Thanks Darren... I've located the cause of the problem. The people
using this script are redirecting stdout before calling this script.
Jim
------------------------------
Date: 15 May 2003 20:05:06 -0700
From: lfazal@hotmail.com (Faz)
Subject: printing output from two files using hash
Message-Id: <13ddbd75.0305151905.7cd6cdd9@posting.google.com>
Hello All
I have two text file1 and file2
file1 has two columns, index number and port number
file2 has to columns, index number and MAC number
Below are the two files
file1
1 a
2 b
3 c
4 b
5 a
file2
1 mac00
2 mac0A
3 macBD
4 macFF
5 macCD
What I am looking for is for the perl script to read file1's second
column(port number) find the corresponding index number, then go to
file2 match that index number and then print the mac addresses
In the end my file output should look like
a mac00
macCD
b mac0A
macFF
c macBD
Any help will be greatly appreciated
------------------------------
Date: Fri, 16 May 2003 06:20:35 GMT
From: pjlees@ics.forthcomingevents.gr (Philip Lees)
Subject: Re: printing output from two files using hash
Message-Id: <3ec4829c.59540171@news.grnet.gr>
On 15 May 2003 20:05:06 -0700, lfazal@hotmail.com (Faz) wrote:
>file1
>1 a
>2 b
>3 c
>4 b
>5 a
>
>file2
>1 mac00
>2 mac0A
>3 macBD
>4 macFF
>5 macCD
>In the end my file output should look like
>
>a mac00
> macCD
>b mac0A
> macFF
>c macBD
Store the input data in two hashes and then build a hash of lists from
that.
my %file1 = qw/1 a 2 b 3 c 4 b 5 a/;
my %file2 = qw/1 mac00 2 mac0A 3 macBD 4 macFF 5 macCD/;
my %output;
while ( my ( $key, $value ) = each %file1 ){
push @{$output{$value}}, $file2{$key};
}
foreach( sort keys %output ){
print;
print "\t$_\n" foreach @{$output{$_}};
}
Phil
--
Ignore coming events if you wish to send me e-mail
------------------------------
Date: Fri, 16 May 2003 01:39:21 GMT
From: tiltonj@erols.com (Jay Tilton)
Subject: Re: problem with starting path
Message-Id: <3ec440f4.232906033@news.erols.com>
magelord@t-online.de (Math55) wrote:
: hi, i have a question concerning the below program. when i start it
: with "/", it works fine (linux), but as soon as i enter another
: starting path like "/home/hello/"
: it stops with an error message: (its dos, because i have no linux
: here)
:
: Tk::Error: parent element "c:./programme/Adobe" does not exist at
: C:/Perl/site/lib/Tk.pm line 228.
:
: whats wrong and how can i change the code so it might work?
The documentation for the add() method of Tk::HList says "A list entry
must be created after its parent is created."
So, '/' must be created before '/home' can be added, and '/home' must
be created before '/home/hello' can be added.
------------------------------
Date: Fri, 16 May 2003 05:40:03 GMT
From: m <dropallx_webmasterx@xmbstevens.comx>
Subject: Re: Re: Image::Size problem under Win 98
Message-Id: <2459cv8nkurjnga9i73i2er7ccl9afq174@4ax.com>
On or around Fri, 16 May 2003 05:27:10 GMT, there was a message,
possibly from tiltonj@erols.com (Jay Tilton), as follows:
>It's a matter of context. If you write, e.g.,
>
> my @values = foo('something') || warn('Yipe!');
>
>since || has higher precedence than assignment, foo() gets called in
>scalar context.
>
>According to the Image::Size documentation, an undef value in the
>first element of the return list indicates an error. You might change
>your code to resemble (untested),
>
> ( my($w,$h,$t) = imgsize("Gopen.jpg") )[0] || warn(...);
Thanks, this seems to be the right answer. I made some
minor modifications, and the module is now working
correctly for me. Cheers, m.
------------------------------
Date: Fri, 16 May 2003 00:50:08 +0200
From: Winfried Koenig <w.koenig@acm.org>
Subject: Re: Sorting $array[0]
Message-Id: <3EC419A0.6050500@acm.org>
nbh wrote:
> Given
>
> @a1 = qw(17 abc);
> @a2 = qw(9 zya);
> @a3 = qw(44 asdff);
>
> $array[0] = \@a1;
> $array[1] = \@a2;
> $array[2] = \@a3;
>
> How to sort $array by the first element and maintain the connection with 17 to abc?
@array = sort {$a->[0] <=> $b->[0]} @array;
Winfried Koenig
------------------------------
Date: 15 May 2003 17:08:28 -0700
From: heeseboutin@yahoo.com (job)
Subject: starting an instance of browser with web forms filled in
Message-Id: <49c6227e.0305151608.5ea449c1@posting.google.com>
Hi,
I would appreciate any help I can get on this prob.
In a win32 environment...
I would like to be able to start netscape from perl at a URL wherein I
must input data into forms.
The data going into the forms is being withdrawn from a spreadsheet.
Can anyone shed some light on how I should pursue this...
I was thinking along the lines of
(please excuse my horrible lack of perl experience, and syntactic
errors)
use lwp
system( start iexplore $URL)
#have a subfunction which pulls the data from the
file
# and inputs into the page, making it visible for
the user.
Thanks for any help
---
------------------------------
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 4990
***************************************