[15566] in Perl-Users-Digest
Perl-Users Digest, Issue: 2978 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon May 8 14:41:35 2000
Date: Mon, 8 May 2000 11:10:35 -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: <957809434-v9-i2978@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Mon, 8 May 2000 Volume: 9 Number: 2978
Today's topics:
Re: making a package (NOT a module) sirena_b@my-deja.com
Re: making a package (NOT a module) sirena_b@my-deja.com
Re: module data usage question nobull@mail.com
Re: more regexp madness extracting data from files. (Tad McClellan)
Need LWP module, but it's not installed on my server <kerry@shetline.com>
Need LWP module, but it's not installed on my server <kerry@shetline.com>
Re: Need LWP module, but it's not installed on my serve <hmerrill@my-deja.com>
Re: Need LWP module, but it's not installed on my serve nobull@mail.com
New posters to comp.lang.perl.misc <gbacon@cs.uah.edu>
Perl on SGI Question <skpurcell@hotmail.com>
Re: perl-corba documentation.. (Teodor Zlatanov)
Printing Arrays <eric.hueckel@vitesse.com>
Re: Printing Arrays <eric.hueckel@vitesse.com>
Re: problem with "system" and file copy (Teodor Zlatanov)
push-ing into a hash <su1005@mailserv.uni-giessen.de>
Re: push-ing into a hash <tony_curtis32@yahoo.com>
Re: push-ing into a hash <hmerrill@my-deja.com>
reading from multiple files <igorleal@dcc.ufmg.br>
Re: reading from multiple files nobull@mail.com
Re: reading from multiple files <mjcarman@home.com>
Re: Regexp char class: mixing ranges and negation? <iltzu@sci.invalid>
search and replace meta tags in perl - newbie question <hpcotter@my-deja.com>
Re: Search engine script change <mjcarman@home.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 08 May 2000 17:37:58 GMT
From: sirena_b@my-deja.com
Subject: Re: making a package (NOT a module)
Message-Id: <8f6u1j$kdf$1@nnrp1.deja.com>
> Would you need, I think, is create different
scripts, and one calling
> the other. I'd say: the normal script calling
the setuid script.
>
How do I do this? I thought it was through
packages, but apparently not.
--Sirena
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 08 May 2000 17:37:59 GMT
From: sirena_b@my-deja.com
Subject: Re: making a package (NOT a module)
Message-Id: <8f6u1l$kdg$1@nnrp1.deja.com>
Sorry if this message was posted twice...
In article <3916213f.13697855@news.skynet.be>,
bart.lateur@skynet.be (Bart Lateur) wrote:
> Would you need, I think, is create different
scripts, and one calling
> the other. I'd say: the normal script calling
the setuid script.
>
How is this done? I thought a package was for
calling one script from another, but apparently
not.
Thanks--
Sirena
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 08 May 2000 17:59:43 +0100
From: nobull@mail.com
Subject: Re: module data usage question
Message-Id: <u97ld5geps.fsf@wcl-l.bham.ac.uk>
phukit@enteract.com writes:
> In each script, I'll have a little configuration hash that contains
> information that one of the subroutines in the module will need to do
> its task properly. The applicable parts of my script look like this:
TMTOWTDI but the quick and dirty way is:
use Mymodule;
%Mymodule::config = (
'server' => "my.server.name.com",
'user' => "username",
'password' => "password",
'db' => "database",
'table' => "table",
<snip several more configuration parameters>
);
> I know I could just pass the subroutine a list of configuration parameters
> into its @_ when I call it, but this is a very large list of parameters and
> would be a major pain to do.
Why not just pass \%config. (Note this is a different approach from
the quick and dirty approach above).
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Mon, 8 May 2000 08:37:12 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: more regexp madness extracting data from files.
Message-Id: <slrn8hdd7o.cem.tadmc@magna.metronet.com>
On 8 May 2000 10:00:45 GMT, The WebDragon <nospam@devnull.com> wrote:
>given the following
>- - -
>
>I'll be using File::Spec to make sure the paths to/from files stay
>intact cross-platform.
>
>6 files (text/html) that all contain a large block of data of the form:
>
>the list of files to be checked will be stored in @inputFiles
>
>
>maps[i++] = new Map("albundyvp","AlBundyVP",1350,"-1",-1);
>maps[i++] = new Map("alienspt1vp","AlienSPT1VP",3257,"-1",-1);
>maps[i++] = new Map("alornmappack","AlornMappack",1956,"-1",-1);
>maps[i++] = new Map("amwaf","AMWAF",22,"-1",-1);
>maps[i++] = new Map("austinpowersvp","AustinPowersVP",1033,"-1",-1);
>maps[i++] = new Map("b2chosenvp","Blood2-ChosenVP",6219,"-1",-1);
>maps[i++] = new Map("camocow","Camo Cow Skin",534,"-1",-1);
>
>
>I want to open each file
perldoc -f open
>in succession,
Perl's looping constructs are described in:
perldoc perlsyn
foreach my $filename ( @inputFiles ) {
open(...) || die ...
}
>extract ONLY the information
>between the () 's
perldoc perlre
>on any line starting with 'maps[i++]'
next unless /^\Qmaps[i++] = new Map(\E([^)]+)/;
my $args = $1;
>and append it to
>an output file
perldoc -f open
>created with today's date and time as the filename, of
>the form YYYY.MM.DD.HH.mm.txt (HH.mm being 24-hour time)
perldoc -f localtime
>each line will be it's own 'record', comma delimited, terminated by \n
>
>the output file will be called maps_database.txt
So which is it?
"maps_database.txt" or "YYYY.MM.DD.HH.mm.txt"?
>each block of records belonging to one of the original 6 files, will be
>preceded by
>
>name_of_the_file.html\n
perldoc perlvar
print OUT "$ARGV\n";
>what would be the most elegant and efficient means to accomplish this in
>perl?
It sounds rather straightforward.
Where's the code you have written so far?
Post it (if it's not too long), and we will help you fix it.
>I'm reasonably certain I can figure out the rest, but it's getting the
>input/extraction all straightened out that I need help with, still being
>somewhat of a perl newbie. :)
Regular expressions, index(), substr() are all associated with
"extracting stuff".
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sun, 07 May 2000 11:02:38 -0400
From: Kerry Shetline <kerry@shetline.com>
Subject: Need LWP module, but it's not installed on my server
Message-Id: <3915858E.B60AD731@shetline.com>
I'm using a commercial web hosting service that runs my web site on an
Apache server (version 1.3.9) which supports Perl CGIs, but the LWP
module doesn't seem to be installed. I don't exactly have sysadmin
privileges here -- I can't even telnet to the server to see what is and
isn't installed.
Can I install the Perl modules I need into my own cgi-bin directory? I
tried the simple-minded approach of just dropping the LWP.pm file and
LWP folder from a set of Perl libraries I have into my cgi-bin
directory, with the not-too-surprising result of getting nothing but the
standard, less-than-useful "Internal Server Error" message back.
All the documentation I've seen on installing Perl modules assumes that
you have the run of the system, not that you're stuck with limited
access privileges. Is there anything I can do other than plead with the
sysadmin?
-Kerry
----------------------------------------------------------------------
See the stars (and Sun, and Moon, and planets) at the Sky View Cafe...
http://www.shetline.com/skyview.html
----------------------------------------------------------------------
------------------------------
Date: Mon, 08 May 2000 16:43:36 GMT
From: Kerry Shetline <kerry@shetline.com>
Subject: Need LWP module, but it's not installed on my server
Message-Id: <8f6qrk$gn0$1@nnrp1.deja.com>
I'm using a commercial web hosting service that runs my web site on an
Apache server (version 1.3.9) which supports Perl CGIs, but the LWP
module doesn't seem to be installed. I don't exactly have sysadmin
privileges here -- I can't even telnet to the server to see what is and
isn't installed.
Can I install the Perl modules I need into my own cgi-bin directory? I
tried the simple-minded approach of just dropping the LWP.pm file and
LWP folder from a set of Perl libraries I have into my cgi-bin
directory, with the not-too-surprising result of getting nothing but the
standard, less-than-useful "Internal Server Error" message back.
All the documentation I've seen on installing Perl modules assumes that
you have the run of the system, not that you're stuck with limited
access privileges. Is there anything I can do other than plead with the
sysadmin?
-Kerry
[PS: My apologies if this message is repeated when my ISP fixes it's news
server!]
----------------------------------------------------------------------
See the stars (and Sun, and Moon, and planets) at the Sky View Cafe...
http://www.shetline.com/skyview.html
----------------------------------------------------------------------
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 08 May 2000 17:00:39 GMT
From: Hardy Merrill <hmerrill@my-deja.com>
Subject: Re: Need LWP module, but it's not installed on my server
Message-Id: <8f6rrc$i2g$1@nnrp1.deja.com>
In article <8f6qrk$gn0$1@nnrp1.deja.com>,
Kerry Shetline <kerry@shetline.com> wrote:
> I'm using a commercial web hosting service that runs my web site on an
> Apache server (version 1.3.9) which supports Perl CGIs, but the LWP
> module doesn't seem to be installed. I don't exactly have sysadmin
> privileges here -- I can't even telnet to the server to see what is
and
> isn't installed.
>
> Can I install the Perl modules I need into my own cgi-bin directory? I
> tried the simple-minded approach of just dropping the LWP.pm file and
> LWP folder from a set of Perl libraries I have into my cgi-bin
> directory, with the not-too-surprising result of getting nothing but
the
> standard, less-than-useful "Internal Server Error" message back.
>
> All the documentation I've seen on installing Perl modules assumes
that
> you have the run of the system, not that you're stuck with limited
> access privileges. Is there anything I can do other than plead with
the
> sysadmin?
Guru's please correct me if I'm wrong - I'm not sure what your setup is,
but you will need to have LWP *installed*(not just drop certain files
into certain directories) on the web server machine. I'm not sure if
you have to be "root" in order to do the installation(of LWP), but you
probably do. The installation will place LWP under the "site_perl"
directory on that(web server) machine, which ensures that it will be
found on the @INC perl path.
Hope this helps.
--
Hardy Merrill
Mission Critical Linux
http://www.missioncriticallinux.com
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 08 May 2000 18:08:16 +0100
From: nobull@mail.com
Subject: Re: Need LWP module, but it's not installed on my server
Message-Id: <u966spgebj.fsf@wcl-l.bham.ac.uk>
Kerry Shetline <kerry@shetline.com> writes:
> Can I install the Perl modules I need into my own cgi-bin directory? I
> tried the simple-minded approach of just dropping the LWP.pm file and
> LWP folder from a set of Perl libraries I have into my cgi-bin
> directory, with the not-too-surprising result of getting nothing but the
> standard, less-than-useful "Internal Server Error" message back.
Did you perhaps forget to do "use lib" too to tell Perl to look for
files in the place you put them?
> All the documentation I've seen on installing Perl modules assumes that
> you have the run of the system, not that you're stuck with limited
> access privileges. Is there anything I can do other than plead with the
> sysadmin?
Pleading with the sysadmin is probably a good idea. If they've
excluded LWP it's probably because they don't want people using it.
If you go ahead and use it anyhow they may consider this a violation
of you terms of service.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Mon, 08 May 2000 15:23:11 GMT
From: Greg Bacon <gbacon@cs.uah.edu>
Subject: New posters to comp.lang.perl.misc
Message-Id: <shdmuvap5uh50@corp.supernews.com>
Following is a summary of articles from new posters spanning a 7 day
period, beginning at 01 May 2000 16:27:56 GMT and ending at
08 May 2000 16:31:31 GMT.
Notes
=====
- A line in the body of a post is considered to be original if it
does *not* match the regular expression /^\s{0,3}(?:>|:|\S+>|\+\+)/.
- All text after the last cut line (/^-- $/) in the body is
considered to be the author's signature.
- The scanner prefers the Reply-To: header over the From: header
in determining the "real" email address and name.
- Original Content Rating (OCR) is the ratio of the original content
volume to the total body volume.
- Find the News-Scan distribution on the CPAN!
<URL:http://www.perl.com/CPAN/modules/by-module/News/>
- Please send all comments to Greg Bacon <gbacon@cs.uah.edu>.
- Copyright (c) 1999 Greg Bacon.
Verbatim copying and redistribution is permitted without royalty;
alteration is not permitted. Redistribution and/or use for any
commercial purpose is prohibited.
Totals
======
Posters: 222 (45.7% of all posters)
Articles: 374 (23.2% of all articles)
Volume generated: 623.7 kb (22.8% of total volume)
- headers: 293.9 kb (5,961 lines)
- bodies: 315.1 kb (11,041 lines)
- original: 246.5 kb (8,943 lines)
- signatures: 14.3 kb (268 lines)
Original Content Rating: 0.782
Averages
========
Posts per poster: 1.7
median: 1.0 post
mode: 1 post - 161 posters
s: 2.7 posts
Message size: 1707.8 bytes
- header: 804.7 bytes (15.9 lines)
- body: 862.9 bytes (29.5 lines)
- original: 674.8 bytes (23.9 lines)
- signature: 39.3 bytes (0.7 lines)
Top 10 Posters by Number of Posts
=================================
(kb) (kb) (kb) (kb)
Posts Volume ( hdr/ body/ orig) Address
----- -------------------------- -------
35 88.0 ( 25.8/ 52.5/ 50.7) The WebDragon <nospam@devnull.com>
11 16.6 ( 9.0/ 6.1/ 3.6) tinamue@gmx.net
8 8.6 ( 6.9/ 1.7/ 1.7) "Michael Schlueter" <michael.schlueter@philips.com>
7 11.0 ( 6.7/ 4.3/ 1.9) "Russell England" <russ@css2.com>
6 8.5 ( 5.3/ 3.2/ 2.0) "David" <david@celtic1888.fsbusiness.co.uk>
5 9.8 ( 5.6/ 4.2/ 4.2) "John" <KidRockYou@yahoo.com>
5 7.9 ( 3.6/ 4.3/ 4.3) scott@industrial-linux.org
4 8.5 ( 3.0/ 5.5/ 3.0) "Shawn McKee" <smckee@umich.edu>
4 15.4 ( 3.5/ 12.0/ 5.9) richard_chen@my-deja.com
4 3.7 ( 2.7/ 1.0/ 0.8) james archer <snowphoton@mindspring.com>
These posters accounted for 5.5% of all articles.
Top 10 Posters by Volume
========================
(kb) (kb) (kb) (kb)
Volume ( hdr/ body/ orig) Posts Address
-------------------------- ----- -------
88.0 ( 25.8/ 52.5/ 50.7) 35 The WebDragon <nospam@devnull.com>
16.6 ( 9.0/ 6.1/ 3.6) 11 tinamue@gmx.net
15.4 ( 3.5/ 12.0/ 5.9) 4 richard_chen@my-deja.com
12.3 ( 3.9/ 8.4/ 8.2) 4 Donald Lancon <lancon@mail.ce.utexas.edu>
11.0 ( 6.7/ 4.3/ 1.9) 7 "Russell England" <russ@css2.com>
10.9 ( 2.4/ 8.5/ 3.6) 3 Stephen Dodd <dodd@ll.mit.edu>
9.8 ( 5.6/ 4.2/ 4.2) 5 "John" <KidRockYou@yahoo.com>
8.6 ( 6.9/ 1.7/ 1.7) 8 "Michael Schlueter" <michael.schlueter@philips.com>
8.5 ( 3.0/ 5.5/ 3.0) 4 "Shawn McKee" <smckee@umich.edu>
8.5 ( 5.3/ 3.2/ 2.0) 6 "David" <david@celtic1888.fsbusiness.co.uk>
These posters accounted for 6.9% of the total volume.
Top 10 Posters by OCR (minimum of three posts)
==============================================
(kb) (kb)
OCR orig / body Posts Address
----- -------------- ----- -------
1.000 ( 1.1 / 1.1) 3 "bentium" <webmaster@harbinonline.com>
1.000 ( 1.7 / 1.7) 8 "Michael Schlueter" <michael.schlueter@philips.com>
1.000 ( 0.7 / 0.7) 4 "Johnny Boy" <johnnylee@totalise.co.uk>
1.000 ( 4.3 / 4.3) 5 scott@industrial-linux.org
0.996 ( 4.2 / 4.2) 5 "John" <KidRockYou@yahoo.com>
0.980 ( 8.2 / 8.4) 4 Donald Lancon <lancon@mail.ce.utexas.edu>
0.971 ( 1.3 / 1.4) 4 Susan <susan.jaeckleNOsuSPAM@kodak.com.invalid>
0.966 ( 50.7 / 52.5) 35 The WebDragon <nospam@devnull.com>
0.828 ( 0.8 / 1.0) 4 james archer <snowphoton@mindspring.com>
0.818 ( 1.1 / 1.3) 3 "Jason Malone" <jamalone@earthlink.net>
Bottom 10 Posters by OCR (minimum of three posts)
=================================================
(kb) (kb)
OCR orig / body Posts Address
----- -------------- ----- -------
0.596 ( 3.6 / 6.1) 11 tinamue@gmx.net
0.547 ( 3.0 / 5.5) 4 "Shawn McKee" <smckee@umich.edu>
0.534 ( 1.1 / 2.1) 4 Jonathan Kazmierczak <johny@supermedia.pl>
0.530 ( 0.8 / 1.6) 3 Ilmari Karonen <usenet11084@itz.pp.sci.fi>
0.526 ( 0.8 / 1.6) 3 "Lyndon Leggate" <lyndon@xellent.co.uk>
0.508 ( 1.3 / 2.5) 3 "Ed Bras" <e.bras@hccnet.nl>
0.497 ( 5.9 / 12.0) 4 richard_chen@my-deja.com
0.445 ( 1.9 / 4.3) 7 "Russell England" <russ@css2.com>
0.426 ( 2.0 / 4.7) 3 "Dan Evans" <danevans@wanadoo.es>
0.422 ( 3.6 / 8.5) 3 Stephen Dodd <dodd@ll.mit.edu>
27 posters (12%) had at least three posts.
Top 10 Targets for Crossposts
=============================
Articles Newsgroup
-------- ---------
34 comp.lang.perl.modules
28 alt.perl
15 de.comp.lang.perl.cgi
14 de.comm.infosystems.www.authoring.cgi
10 comp.lang.perl.moderated
9 microsoft.public.inetserver.asp.general
9 comp.lang.perl
7 comp.lang.java.help
7 comp.unix.shell
7 comp.lang.java.databases
Top 10 Crossposters
===================
Articles Address
-------- -------
6 Carey bingham <carey_bingham@TransCanada.com>
5 scott@industrial-linux.org
4 "newbie" <xuyli@hotmail.com>
4 rhchui@yahoo.com
4 "Jon A. Cruz" <joncruz@geocities.com>
4 toma@fluence.com
4 Bernard Chandler <bernie@nationwide.net>
3 "Martijn Tonies" <remove_seal97@dds.nl>
3 Chuck Lawhorn <CharlieL3@yahoo.com>
3 vlatko@speakeasy.org
------------------------------
Date: Mon, 8 May 2000 10:45:08 -0500
From: "spurcell" <skpurcell@hotmail.com>
Subject: Perl on SGI Question
Message-Id: <3916e0ed$0$21854@wodc7nh1.news.uu.net>
Hello,
I use ActiveState Perl on a NT server, and that is where my experience lies.
Anyway, I need to get the latest Perl installed on an SGI machine. So anyway
I checked around Cpan, and it looks like I will have to compile a version of
Perl to run there. Anyway, I don't have any compilers here.
So anyway, my mission is to get the Perl running on the SGI running Irix
6.5. I am only a Perl guy, and have no experience with C compilers or the
like, so does anyone know what I can do to get this to happen? Also, if this
is do-able, can I also load modules? Like the Fcntl, DBI, etc. And if that
is the case will I need compilers on there, or are they just packages.
I could use any help anyone is willing to share.
Thanks
Scott
------------------------------
Date: 8 May 2000 10:31:31 -0500
From: tzz@iglou.com (Teodor Zlatanov)
Subject: Re: perl-corba documentation..
Message-Id: <3916cfc3$1_1@news.iglou.com>
<Pine.GSO.4.10.10005061008210.6766-100000@user2.teleport.com>:Tom Phoenix (rootbeer@redcat.com):comp.lang.perl.misc:Sat, 6 May 2000 10:11:29 -0700:quote:
: On Fri, 5 May 2000, Joydeep Roy Chowdhury wrote:
:
: > i want to learn about implementation of CORBA in Perl. where can I get
: > started ?
:
: Maybe you want to get an introductory book on Perl. Many folks around here
: recommend O'Reilly's book, "Learning Perl". Once you've learned the
: basics, you could search CPAN for a helpful module.
:
: http://search.cpan.org/search?mode=module&query=corba
: http://search.cpan.org/
I would also look at COPE:
http://www.lunatech.com/research/corba/cope/
in addition to the MICO and ORBit bindings available on CPAN as
modules. It should be noted that there are no CORBA implementations
on CPAN, only bindings to ORBs. There is no such thing as a CORBA
implementation. You implement the ORB, or services, or bindings.
--
Teodor Zlatanov <tzz@iglou.com>
"Brevis oratio penetrat colos, longa potatio evacuat ciphos." -Rabelais
------------------------------
Date: Mon, 08 May 2000 09:15:23 -0600
From: Eric Hueckel <eric.hueckel@vitesse.com>
Subject: Printing Arrays
Message-Id: <3916DA0B.547CBF4F@vitesse.com>
To All,
I am trying to print individual elements of
an array using a loop structure as follows:
for ($i = $num_modules; $i >= 1; $i--) {
print $block[$i],"\n";
}
But if the array has say, 4 elements the code only prints
the last element.
I am certain that the array conyains data since
the following print statement:
print @block;
Prints all the elments of the array concatenated
together.
Any help would be greatly appreciated.
Thanks !
--
Eric Hueckel
Design Engineer
Vitesse Semiconductor
ASIC Design Services
Tel 719.867.4434
Fax 719.867.6203
eric.hueckel@vitesse.com
------------------------------
Date: Mon, 08 May 2000 09:26:23 -0600
From: Eric Hueckel <eric.hueckel@vitesse.com>
Subject: Re: Printing Arrays
Message-Id: <3916DC9F.A255973B@vitesse.com>
Never mind.
I see what I was doing wrong.
Thanks anyway.
Eric Hueckel
Eric Hueckel wrote:
>
> To All,
>
> I am trying to print individual elements of
> an array using a loop structure as follows:
>
> for ($i = $num_modules; $i >= 1; $i--) {
>
> print $block[$i],"\n";
>
> }
>
> But if the array has say, 4 elements the code only prints
> the last element.
>
> I am certain that the array conyains data since
> the following print statement:
>
> print @block;
>
> Prints all the elments of the array concatenated
> together.
>
> Any help would be greatly appreciated.
>
> Thanks !
> --
> Eric Hueckel
> Design Engineer
> Vitesse Semiconductor
> ASIC Design Services
> Tel 719.867.4434
> Fax 719.867.6203
> eric.hueckel@vitesse.com
--
Eric Hueckel
Design Engineer
Vitesse Semiconductor
ASIC Design Services
Tel 719.867.4434
Fax 719.867.6203
eric.hueckel@vitesse.com
------------------------------
Date: 8 May 2000 10:17:01 -0500
From: tzz@iglou.com (Teodor Zlatanov)
Subject: Re: problem with "system" and file copy
Message-Id: <3916cc5d$1_1@news.iglou.com>
<8f4n4k$80q$1@nnrp1.deja.com>:David Pautler (pautler@hawaii.edu):comp.lang.perl.misc:Sun, 07 May 2000 21:28:02 GMT:quote:
: In article <3911a125$1_1@news.iglou.com>, tzz@iglou.com (Teodor Zlatanov) wrote:
: > I would use glob (perldoc -f glob) as it uses /bin/csh, which will
: > understand tilde notation, wildcards, etc. You can do your own,
: > as Paul suggested, but it's easier to use the built-in functions.
:
: Strangely, glob("$path/*") doesn't seem to return filenames that
: have extensions.
:
: Also, glob("$path/*.*") doesn't return anything when the directory
: contains filenames with extensions, although changing ".*" to
: a particular extension does return filenames.
:
: Is using a system call the only option in these cases?
Well, as Tom suggested, you can upgrade to Perl 5.6. If this is
not an option, you can just use opendir/readdir
(perldoc -f readdir has an example) and look through the results
yourself. I never recommend system calls when you can get the
job done without them :)
You could also use the File::Find module, but that would almost
certainly be overkill if you only want to process one directory.
If you want to descend a directory tree, however, it's your best
choice.
--
Teodor Zlatanov <tzz@iglou.com>
"Brevis oratio penetrat colos, longa potatio evacuat ciphos." -Rabelais
------------------------------
Date: Mon, 8 May 2000 17:56:40 +0200
From: Thomas Schmitt <su1005@mailserv.uni-giessen.de>
Subject: push-ing into a hash
Message-Id: <Pine.GSO.4.21.0005081752120.29336-100000@s1.stud.uni-giessen.de>
I'm trying to set up a hash of arrays. $idx and $scalar are two elements
out of a db, where $idx is a an index which can have repeating values and
should be used as keys to fill a hash of arrays. Inside the read-out loop
I tried a push-statement like this:
push (@hash_name{$idx}, $scalar);
It doesn't work. Can anybody help me out?
------------------------------
Date: 08 May 2000 11:24:52 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: push-ing into a hash
Message-Id: <87zoq1ovqi.fsf@shleppie.uh.edu>
>> On Mon, 8 May 2000 17:56:40 +0200,
>> Thomas Schmitt <su1005@mailserv.uni-giessen.de> said:
> I'm trying to set up a hash of arrays. $idx and $scalar
> are two elements out of a db, where $idx is a an index
> which can have repeating values and should be used as
> keys to fill a hash of arrays. Inside the read-out loop
> I tried a push-statement like this:
> push (@hash_name{$idx}, $scalar);
> It doesn't work. Can anybody help me out?
You have to cast the hash key into an array context,
push @{$hash_name{$idx}}, $scalar;
hth
t
------------------------------
Date: Mon, 08 May 2000 16:52:08 GMT
From: Hardy Merrill <hmerrill@my-deja.com>
Subject: Re: push-ing into a hash
Message-Id: <8f6rbg$hcq$1@nnrp1.deja.com>
In article
<Pine.GSO.4.21.0005081752120.29336-100000@s1.stud.uni-giessen.de>,
Thomas Schmitt <su1005@mailserv.uni-giessen.de> wrote:
> I'm trying to set up a hash of arrays. $idx and $scalar are two
elements
> out of a db, where $idx is a an index which can have repeating values
and
> should be used as keys to fill a hash of arrays. Inside the read-out
loop
> I tried a push-statement like this:
>
> push (@hash_name{$idx}, $scalar);
>
> It doesn't work. Can anybody help me out?
>
I hope I'm not off the mark here, but try this:
my %hash_name = (); ### initialize the hash
loop start
$hash_name{$idx} = $scalar;
loop end
Since your goal is to have the product be a hash of arrays, I assume
that $scalar is a reference to an array.
Hope this helps.
--
Hardy Merrill
Mission Critical Linux
http://www.missioncriticallinux.com
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 8 May 2000 10:03:56 -0300
From: Igor Campos Leal <igorleal@dcc.ufmg.br>
Subject: reading from multiple files
Message-Id: <Pine.GSO.4.21.0005081001460.654-100000@turmalina.dcc.ufmg.br>
Hi!
I need help! I want to read from three files at a same time not
with:
while (<file1>)
{
blablalaba
}
while (<file2>)
{
blablabla
}
while (<file3>)
{
balballab
}
How can I read from a specific file? Like in C : fscanf (file1,
"%s", &string)...
Any help will be wellcome... Waiting for that...
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\ /
/ Igor Campos Leal \
\ Ciencia da Computacao /
/ DCC - UFMG \
\ e-mail: igorleal@dcc.ufmg.br /
/ igor@acesso.com.br \
\ ICQ# 37936364 /
/ \
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
------------------------------
Date: 08 May 2000 17:43:21 +0100
From: nobull@mail.com
Subject: Re: reading from multiple files
Message-Id: <u9d7mxgfh2.fsf@wcl-l.bham.ac.uk>
Igor Campos Leal <igorleal@dcc.ufmg.br> writes:
> I need help! I want to read from three files at a same time not
> with:
> while (<file1>)
The <filehandle> operator (aka the readline() function) can be used outside
of while(). In this context it looses the magical "defined( $_ =
... )" wrapper and behaves as an ordinary function.
For details:
perldoc perlop
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Mon, 08 May 2000 11:30:20 -0500
From: Michael Carman <mjcarman@home.com>
Subject: Re: reading from multiple files
Message-Id: <3916EB9C.6AF678EB@home.com>
Igor Campos Leal wrote:
>
> Hi!
> I need help! I want to read from three files at a same time not
> with:
> while (<file1>)
> {
> blablalaba
> }
> while (<file2>)
> {
> blablabla
> }
> while (<file3>)
> {
> balballab
> }
> How can I read from a specific file? Like in C : fscanf (file1,
> "%s", &string)...
You can explicity read a line from the file you want:
(Assuming three proper open() calls which checked for success.)
$line1 = <FILE1>;
$line2 = <FILE2>;
$line3 = <FILE3>;
Without knowing more about your files (like, do they all have the same
number of lines, and does line 1 in file 1 correspond to line 1 in files
2 and 3?) I can't tell you how to build a loop around that.
Perl also has a read() function. That might be what you want. cf.
'perldoc -f read'
-mjc
------------------------------
Date: 8 May 2000 14:10:37 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: Regexp char class: mixing ranges and negation?
Message-Id: <957794651.22420@itz.pp.sci.fi>
In article <8f33ol$j4s$1@nnrp1.deja.com>, Tim Richardson wrote:
>I'm lazy. I want a regular expression that will match all visible
>characters (7-bit will do) except , and /
[^,/\0-\037\177-\377]
If you want to allow printable 8-bit ISO Latin characters, replace
\377 with \237.
--
Ilmari Karonen - http://www.sci.fi/~iltzu/
Please ignore Godzilla and its pseudonyms - do not feed the troll.
------------------------------
Date: Mon, 08 May 2000 16:37:25 GMT
From: Hilary Cotter <hpcotter@my-deja.com>
To: hilaryk@netscape.net
Subject: search and replace meta tags in perl - newbie question
Message-Id: <8f6qg2$g48$1@nnrp1.deja.com>
Hi
I am trying to do a search and replace of <HEAD> with <HEAD<meta
name=keywords content="dejanews usenet newsgroup articles search query
discussion">
can anyone write the syntax for the search and replace function I
should use in Perl.
ie s/<HEAD>/<HEAD<meta name=keywords content="dejanews usenet newsgroup
articles search query discussion">/g
I can't get this to work.
Thanks in advance
Hilary Cotter
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 08 May 2000 08:31:01 -0500
From: Michael Carman <mjcarman@home.com>
Subject: Re: Search engine script change
Message-Id: <3916C195.8A74A3E5@home.com>
trick@tig.com.au wrote:
>
> I found a good search engine script that i need
> (http://www.getcgi-freescripts.com/search/) the only problem is it
> spits out results unnumbered or as unordered <li>. Does anyone know
> how to chnage it so the results are numbered, eg 1-10 on first page
> and 11-20 on second.
That really isn't a Perl question, it's an HTML one. <LI> is just "List
Item." You want to create your list with <OL> (Ordered List) instead of
<UL> (Unordered List). For pages after the first one, you'll need to add
an attribute to tell it what number to start on. You can use either <OL
START=n> or <LI VALUE=n> where 'n' is (obviously) the number you want.
You will probably need to make some small changes in the script to keep
track of which range of results you're displaying.
-mjc
------------------------------
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 2978
**************************************