[11806] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 5406 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Apr 17 14:07:27 1999

Date: Sat, 17 Apr 99 11:00:20 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sat, 17 Apr 1999     Volume: 8 Number: 5406

Today's topics:
    Re: 'Require' options <tchrist@mox.perl.com>
    Re: Can i run cgi in Win95 of my PC ?? (Abigail)
    Re: Can i run cgi in Win95 of my PC ?? <dgris@moiraine.dimensional.com>
        Database module documentation & help... <not@gonna.tell>
    Re: FAQ 9.3: How do I remove HTML from a string? <gellyfish@gellyfish.com>
        Net::NNTP <eyuan@prodigy.net>
    Re: New FAQ: How can I read in an entire file all at on <dgris@moiraine.dimensional.com>
    Re: Newbie needs help with pattern search and concatena <aqumsieh@matrox.com>
    Re: Perl Development Environment lvirden@cas.org
    Re: Perl vs. OTHER scripting languages ? When/Why to us lvirden@cas.org
    Re: position in s///g? <dgris@moiraine.dimensional.com>
    Re: Question about Connection <dgris@moiraine.dimensional.com>
        Showing contents of a direcotry <rusenet@bigfoot.com>
    Re: Spell checking CGI inputs on WIN95/NT4 <gellyfish@gellyfish.com>
        Split sizes instead of pattern? <mats.pettersson@falukuriren.se>
        Splitting length instead of delimiting character? <mats.pettersson@falukuriren.se>
        Splitting length instead of delimiting character? <mats.pettersson@falukuriren.se>
        Splitting length instead of delimiting character? <mats.pettersson@falukuriren.se>
        Splitting length instead of delimiting character? <mats.pettersson@falukuriren.se>
        Tool Reuse Considered Beneficial (was: New FAQ: How can <tchrist@mox.perl.com>
    Re: why won't this statement work @array=<*.*> <gellyfish@gellyfish.com>
    Re: Would anyone care to teach me perl? (Tad McClellan)
    Re: zipped perlman <gellyfish@gellyfish.com>
    Re: { } question/problem (Tad McClellan)
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: 17 Apr 1999 09:35:09 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: 'Require' options
Message-Id: <3718aa2d@cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, 
    "Egon Kraaikamp" <kraaikae@xs4all.nl> writes:
:Is it possible to 'require' a file outside the server's own filesystem (Unix
:and/or NT) e.g. by reffering to another IP address?
:Anyone having experiences with this?

You can only require files.  The trick, therefore, is to make
the remote machine look like a file.  The answer, of course,
is to use NFS mounts.  

--tom
-- 
Unix is defined by whatever is running on Dennis Ritchie's machine.


------------------------------

Date: 17 Apr 1999 15:35:17 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Can i run cgi in Win95 of my PC ??
Message-Id: <7fa9nl$gjc$1@client2.news.psi.net>

Kevin !;!;!;!;!;!;!;!;!;!;!;!;!;!;!;!;!;!;!;!;!;
(austin95002887@yahoo.com) wrote on MMLV September MCMXCIII in <URL:news:1107_924346326@austin>:
 .. 
 .. Can i run cgi in Win95 of my PC ??


That's like asking 'can I speak an egg in my cellphone' in a group
about penguins. 

CGI is a protocol, not a program.


This groups is about Perl. It's not about CGI, it's not about Windows,
and it's not about PCs.

Please make up your mind what you want to do, how to formulate it, and
then look around for the appropriate group to ask. Otherwise, you are
just re-enforcing the perception that Windows users are clueless.


Abigail
-- 
perl -wle 'print "Prime" if (1 x shift) !~ /^1?$|^(11+?)\1+$/'


------------------------------

Date: 17 Apr 1999 10:41:37 -0600
From: Daniel Grisinger <dgris@moiraine.dimensional.com>
Subject: Re: Can i run cgi in Win95 of my PC ??
Message-Id: <m37lrbw666.fsf@moiraine.dimensional.com>

some bozo with entirely too many useless characters in his name writes:

> Can i run cgi in Win95 of my PC ??

Yes, of course.

> ( I have no Network Card, and i really do not want to buy one 
> because of this reason. )

Ohhh, never mind.  You can't do it without ethernet. 

In fact, the first thing that perl does when it is invoked by a
webserver is verify that there is a functional ethernet card on the
machine.  If there isn't perl exits instantly with an obscure
error message.  

Sorry.

dgris
-- 
Daniel Grisinger          dgris@moiraine.dimensional.com
perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print 
m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'


------------------------------

Date: Sat, 17 Apr 1999 13:21:56 -0400
From: "Doug Crabtree" <not@gonna.tell>
Subject: Database module documentation & help...
Message-Id: <7fag0q$cfg$1@camel29.mindspring.com>

My ISP gives me access to the following Perl modules:

AnyDBM_File.pm
db_file
NDBM_File.pm
ODBM_File.pm
SDBM_File.pm
gdbm_file
perl5db.pl

I have a simple database task that I need to do, one that even a text file
would work for.  The problem is that with around 1,000,000 entries, changing
one may take too long.  My first question is, which module is the best for
simple database tasks.  My second question is, where can I find
examples/documentation of the functions on these modules?

Thanks,
Doug




------------------------------

Date: 17 Apr 1999 15:46:44 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: FAQ 9.3: How do I remove HTML from a string?
Message-Id: <7faad4$7op$1@gellyfish.btinternet.com>

On Fri, 16 Apr 1999 15:13:39 -0400 Allan M. Due wrote:
> Tom Christiansen wrote in message <37177f08@cs.colorado.edu>...
> :
> :    The most correct way (albeit not the fastest) is to use HTML::Parse
> :    from CPAN (part of the HTML-Tree package on CPAN).
> 
> I thought the use of HTML::Parse has become deprecated in favor of Parser?
> 

Infact  HTML::Parse is now basically a stub over HTML::Treebuilder.

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


------------------------------

Date: Sat, 17 Apr 1999 12:57:52 -0700
From: "E. Yuan" <eyuan@prodigy.net>
Subject: Net::NNTP
Message-Id: <3718E7BD.D66C0C7B@prodigy.net>

Hi, there:

I have a question regarding the NNTP module, and I would appreciate any
thoughts you may have..

I was trying to write a News client, and for that I followed the
examples in Tom Christiansen's "Perl Cookbook". But the sample program
in the book didn't work - it requires the Net::NNTP module, but in my
ActiveState Perl (build 515), there's no such a module. There is
however, a module called nntp.pm under LWP::Protocol. So I tried to use
that, it didn't work either, because this LWP::Protocol::NNTP module
also requires Net::NNTP.

My questiones are: is my Perl installation wrong? where can I get the
right NNTP module?

Thanks in advance for your help!



------------------------------

Date: 17 Apr 1999 10:22:50 -0600
From: Daniel Grisinger <dgris@moiraine.dimensional.com>
Subject: Re: New FAQ: How can I read in an entire file all at once?
Message-Id: <m3lnfrw71h.fsf@moiraine.dimensional.com>

mitiaNOSPAM@nwu.edu.invalid (Dmitry Epstein) writes:

> 1. Unless you are dealing with very large files and are afraid to run
> out of memory, I don't see why reading entire files is so bad.  Memory
> is cheap.

The problem with reading the entire file into memory is that it may be
small today, but you will probably be required at some point to turn
the code loose on a file that isn't small.  Sucking 10 or 20 megs of
data into memory is one thing, sucking a gigabyte of data is something
entirely different.

> 2. If you are reading (or writing) from more than one file at the same
> time, you'll probably find that reading/writing entire files is always
> much faster than reading/writing them line by line.

If you are reading from and writing to several files simultaneously
you should be using 4 arg select for I/O multiplexing, you shouldn't
just be reading everything into memory.  Once again, the problem is
that any program that requires all files to be held in memory won't
scale.

Beyond that, unless you are doing lots of small reads or writes you
won't see enough of a difference in speed for your I/O time to matter.
If it is that important to microoptimize your disk accesses then you
need to be playing with various buffer sizes in C, not sucking in
additional data with perl.

> 3. There are plenty of contexts in which line breaks are irrelevant
> for the task at hand, and therefore it doesn't make any sense to
> process files line by line.  For instance, in many languages, such as
> C and Perl, also in HTML, line breaks are equivalent to spaces.  Also,
> if you are going to repeatedly go over the entire file, obviously you
> will be better off having read the entire file in memory rather than
> reading it from disk over and over again.

There are very few algorithms that require that the entire data set be
manipulated as a whole.  Most of the time, even with the examples
(HTML, perl, C) you give, you'll be happier reading your data in
smaller chunks.  There's a reason that the documentation for
HTML::Parser recommends using a chunk size between 256 and 512
bytes--it's more efficient.

> Correct me if I am wrong, but I always thought that given the choice
> between a neat, clean, and portable Perl implementation and a shell
> call you should always choose the former. 

I agree entirely with this sentiment.  I'll be damned if I'm going to
let somebody else's silly bugs (in a program that I don't even have
the original source for) be a problem in my code.  I only ever use
system() or backtics when I'm doing something from the command line.
In real programs I _never_ shell out.

dgris
-- 
Daniel Grisinger          dgris@moiraine.dimensional.com
perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print 
m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'


------------------------------

Date: Fri, 16 Apr 1999 18:10:29 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
To: greg.harrison@analog.com
Subject: Re: Newbie needs help with pattern search and concatenation snippet
Message-Id: <x3ywvzc9pyj.fsf@tigre.matrox.com>


greg <greg_harrison@analog.com> writes:

> Here's what I am trying to do: Assuming I have read a file in using
> 
>     # read it in
>         @lines = <FILE>;
>         close(FILE);
> 
> I now need to traverse each line, see if it has a string in it that was
> specified by the user.
> If it does, I then need to check to see if the line ends with a
> semicolon.  If it does, I want to leave the line intact and go on to the
> next line.
> If it doesn't, I need to join it with the following line.
> I then want to check this new line (which has been formed
> by the concatenation of the two) and if it still doesn't end with a
> semicolon, then join it with the next line again....etc..etc..until it
> finally ends with a semicolon. 

[snip]

> Once I have a line fully concatenated until it ends with a semicolon,
> I will either dump it to stdout or to a file (as specified by user).

What a twisted way to do what seems to be a simple thing. Basically,
what you want (and correct me if I'm wrong) is to read from a file up
to the next semicolon. Look into using the $/ special variable (search
for it in the perlvar documentation for more info). Basically, it
specifies the input record separator which Perl uses to read from a
filehandle. By default, this is a '\n', so Perl's definition of a line
will be a string that ends in a '\n'. But you can override that.

Remember: Perl is your slave. Let *it* do the dirty work.

Here's how I would do it:

#########
open FILE, $my_file or die "Couldn't open $my_file: $!\n";
{		# here I localize the change of $/ so as not
		# to break anything else in the code
	local $/ = ';';
	while (<FILE>) {
		next if /$pattern/;   # or whatever you want to do
		print;
	}
}

close F or warn "Unable to close $my_file: $!\n";
#########

Of course, the body of the while() loop will vary according to your
needs.

HTH,
Ala



------------------------------

Date: 17 Apr 1999 14:53:02 GMT
From: lvirden@cas.org
Subject: Re: Perl Development Environment
Message-Id: <7fa78e$3n$1@srv38s4u.cas.org>


:In article <Pine.LNX.4.04.9904111427250.20923-100000@localhost.pants.org>,
:	aaron@soltec.net (Aaron) writes:
:> I think more of what we mean is

>From <URL: http://www.purl.org/NET/Tcl-FAQ/part4.html> I have software 
like:



What: C-Forge IDE
Where: <URL: http://www.codeforge.com/>
	<URL: http://www.codeforge.com/linux/download.html>
Description: Multi-user integrated development environment with
	full project management, edit/compile/debug cycle support,
	abstraction of the makefile concept, and support for
	C/C++, Oracle ProC/C++, Perl, Tcl, Python, Java, Qt, Pascal,
	FORTRAN, Modula-2, and assembler.
	Both a free and commercial version of this product is available.
	Available on Linix Intel and Alpha platforms.
Updated: 02/1999
Contact: <URL: mailto:consult@codeforge.com>


What: Elixir IDE
Where: <URL: http://www.elixir.com.sg/>
Description: An programmer's editor developed in Java and sporting a Swing
	user interface.  Features a pluggable architecture supporting
	compilers (including JDK 1.1, 1.2, and Jike),
	scripting engines (including Scheme and Tcl),
	and version control systems (including RCS).
	Features file status indicator, syntax coloring, etc.
	A free lite version with a 10 Java file limit is available.
Updated: 10/1998
Contact: <URL: mailto:info@elixir.com.sg> (Elixir Technology Pte Ltd.)


I suspect there are others.
-- 
<URL: mailto:lvirden@cas.org> Quote: Saving the world before bedtime.
<*> O- <URL: http://www.purl.org/NET/lvirden/>
Unless explicitly stated to the contrary, nothing in this posting
should be construed as representing my employer's opinions.


------------------------------

Date: 17 Apr 1999 14:59:20 GMT
From: lvirden@cas.org
Subject: Re: Perl vs. OTHER scripting languages ? When/Why to use it ?
Message-Id: <7fa7k8$am$1@srv38s4u.cas.org>


According to Abigail <abigail@fnx.com>:
:Michael Genovese (mikeg@slpmbo.ed.ray.com) wrote on MMLII September
:MCMXCIII in <URL:news:3714AC6C.967940A5@slpmbo.ed.ray.com>:
:[] Hello:
:[] 
:[] I've been asked by my manager to come up with reasons, arguments,
:[] and/or guidelines for choosing one scripting language over another.

:[] He recently decided that we WILL do our scripts in C-SHELL & AWK/NAWK,
:[] but is now willing to modify his position if I can come up with
:[] compelling arguments to do otherwise.

:Ask him to write a short script that fetches a Web page from the
:Internet, and stores it in a database.
:
:In 20 lines tops. Let him measure the time to develop such a program.

Using _only_ the scripting language - no far making use of specialized
programs he grabs off the internet (like wget, etc.).

-- 
<URL: mailto:lvirden@cas.org> Quote: Saving the world before bedtime.
<*> O- <URL: http://www.purl.org/NET/lvirden/>
Unless explicitly stated to the contrary, nothing in this posting
should be construed as representing my employer's opinions.


------------------------------

Date: 17 Apr 1999 10:34:54 -0600
From: Daniel Grisinger <dgris@moiraine.dimensional.com>
Subject: Re: position in s///g?
Message-Id: <m3d813w6hd.fsf@moiraine.dimensional.com>

ada@fc.hp.com (Andrew Allen) writes:

> But even that doesn't work. At least not on 5.005_02 (is that bleeding
> edge enough?).

Nope, that's not recent enough.  When Ilya says `bleeding edge'
what he really means is- 

 `The latest release along the dev branch plus the latest patches from
 p5p'.

In other words, a place that most perl user Don't Want To Go.

dgris
-- 
Daniel Grisinger          dgris@moiraine.dimensional.com
perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print 
m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'


------------------------------

Date: 17 Apr 1999 10:55:27 -0600
From: Daniel Grisinger <dgris@moiraine.dimensional.com>
Subject: Re: Question about Connection
Message-Id: <m3wvzbuqyo.fsf@moiraine.dimensional.com>

abigail@fnx.com (Abigail) writes:

> I don't recommend smoke signals though, unless you only want to read
> the other file in daylight, and chances of fog are low.

Party-pooper.

Watching bubbles of smoke rise from your motherboard is tremendously
exciting.

dgris
-- 
Daniel Grisinger          dgris@moiraine.dimensional.com
perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print 
m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'


------------------------------

Date: Sat, 17 Apr 1999 19:50:12 +0200
From: "R!k" <rusenet@bigfoot.com>
Subject: Showing contents of a direcotry
Message-Id: <7fah8s$mss$1@enterprise.cistron.nl>

I need to create an .pl that does the following for me

first it of course creates an heather like

<html>
<head>
</head>
<body bla bla>
<img src=ba bla>
<b>These are the contents blabla....</B>


and then it must write all the files in a directory, in a alphabetical order
(standard i'd say), in a table. i think i'll have to do something like

print "<table blabla>\n";
print "<tr><td>"+


 ..?
anyway it sould do a while or for..to (etc) to print all the files...
And then of course a footer..

Anyone who could help?

Rik




------------------------------

Date: 17 Apr 1999 14:50:56 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Spell checking CGI inputs on WIN95/NT4
Message-Id: <7fa74g$7n0$1@gellyfish.btinternet.com>

On Fri, 16 Apr 1999 18:48:37 -0400 Richard Noble wrote:
> Does anyone have any idea how to spell check a users input from a cgi
> form? I own VisualSpeller which is a OCX control for VB. Can Win32 OLE
> provide me access to this? If not can I link to any of the functions in
> WORD97?

I'm not sure whether you can use OCX controls from Win32::OLE because of
the way that the interface works - of course you can always try ...

Alternatively you can use the module Search::Dict to implement your own
spell checker - I posted an example here a short while back which you
will be able to find via DejaNews.

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


------------------------------

Date: Sat, 17 Apr 1999 19:49:57 +0200
From: Mats Pettersson <mats.pettersson@falukuriren.se>
Subject: Split sizes instead of pattern?
Message-Id: <3718C9C5.69E16E7C@falukuriren.se>

Hi!



I'm currently writing a script that would split up lines in a file into

fields for import into a database.



However most examples i see uses the split /x/ method, where in my case

i would need to split a line in different sizes into an array.



A line in the file may look as follows:



1999-01   6   4   2   1   7       5   3



So the first field should be 7 characters the second 4 characters the

third 4 characters and so on. Some of the fields might be empty (like

the 7th in this example) so thats wy i just can't split with whitespace.



Is there som sort of '@fields = split_size /7,4,4,4.../' command in

perl?



I've searched for examples and such, but don't seem to find any.



Mats


------------------------------

Date: Sat, 17 Apr 1999 19:20:43 +0200
From: Mats Pettersson <mats.pettersson@falukuriren.se>
Subject: Splitting length instead of delimiting character?
Message-Id: <3718C2EB.80CB147E@falukuriren.se>

Hi!

I'm currently writing a script that would split up lines in a file into
fields for import into a database.

However most examples i see uses the split /x/ method, where in my case
i would need to split a line in different sizes into an array.

A line in the file may look as follows:

1999-01   6   4   2   1   7       5   3

So the first field should be 7 characters the second 4 characters the
third 4 characters and so on. Some of the fields might be empty (like
the 7th in this example) so thats wy i just can't split with whitespace.

Is there som sort of '@fields = split_size /7,4,4,4.../' command in
perl?

I've searched for examples and such, but don't seem to find any.

Mats


------------------------------

Date: Sat, 17 Apr 1999 19:23:36 +0200
From: Mats Pettersson <mats.pettersson@falukuriren.se>
Subject: Splitting length instead of delimiting character?
Message-Id: <3718C398.14A9CA90@falukuriren.se>

Hi!

I'm currently writing a script that would split up lines in a file into
fields for import into a database.

However most examples i see uses the split /x/ method, where in my case
i would need to split a line in different sizes into an array.

A line in the file may look as follows:

1999-01   6   4   2   1   7       5   3

So the first field should be 7 characters the second 4 characters the
third 4 characters and so on. Some of the fields might be empty (like
the 7th in this example) so thats wy i just can't split with whitespace.

Is there som sort of '@fields = split_size /7,4,4,4.../' command in
perl?

I've searched for examples and such, but don't seem to find any.

Mats


------------------------------

Date: Sat, 17 Apr 1999 19:25:36 +0200
From: Mats Pettersson <mats.pettersson@falukuriren.se>
Subject: Splitting length instead of delimiting character?
Message-Id: <3718C410.1DB6F062@falukuriren.se>

Hi!

I'm currently writing a script that would split up lines in a file into
fields for import into a database.

However most examples i see uses the split /x/ method, where in my case
i would need to split a line in different sizes into an array.

A line in the file may look as follows:

1999-01   6   4   2   1   7       5   3

So the first field should be 7 characters the second 4 characters the
third 4 characters and so on. Some of the fields might be empty (like
the 7th in this example) so thats wy i just can't split with whitespace.

Is there som sort of '@fields = split_size /7,4,4,4.../' command in
perl?

I've searched for examples and such, but don't seem to find any.

Mats


------------------------------

Date: Sat, 17 Apr 1999 19:26:15 +0200
From: Mats Pettersson <mats.pettersson@falukuriren.se>
Subject: Splitting length instead of delimiting character?
Message-Id: <3718C437.1852DAAA@falukuriren.se>

Hi!

I'm currently writing a script that would split up lines in a file into
fields for import into a database.

However most examples i see uses the split /x/ method, where in my case
i would need to split a line in different sizes into an array.

A line in the file may look as follows:

1999-01   6   4   2   1   7       5   3

So the first field should be 7 characters the second 4 characters the
third 4 characters and so on. Some of the fields might be empty (like
the 7th in this example) so thats wy i just can't split with whitespace.

Is there som sort of '@fields = split_size /7,4,4,4.../' command in
perl?

I've searched for examples and such, but don't seem to find any.

Mats


------------------------------

Date: 17 Apr 1999 11:56:54 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Tool Reuse Considered Beneficial (was: New FAQ: How can I read in an entire file all at once?)
Message-Id: <3718cb66@cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, 
    Daniel Grisinger <dgris@moiraine.dimensional.com> writes:
:I agree entirely with this sentiment.  I'll be damned if I'm going to
:let somebody else's silly bugs (in a program that I don't even have
:the original source for) be a problem in my code.  I only ever use
:system() or backtics when I'm doing something from the command line.
:In real programs I _never_ shell out.

That's absolutely ridiculous.  I challenge you to implement the following
operations without calling another program.  

 *  let someone edit a file 	    using their preferred editor
 *  let someone see  a webpage 	    using their preferred web browser
 *  let someone send a message 	    using their preferred mailer 
 *  let someone view through a file using their preferred pager
 *  get the current load average
 *  run a command window (xterm, kterm, gnome-terminal, Eterm, etc)
 *  display a manpage
 *  copy a file to a remote system
 *  view some postscript
 *  check a group of files into an RCS tree
 *  get a listing of all currently configured network interfaces
 *  monitor the printer queue
 *  check who all is logged in to this or a remote system
 *  get a listing of your kernel's current network routes
 *  check which processes are stopping you from unmounting /cdrom

Use the commands from the toolkit.  That's what it's there for.  
Do *not* reinvent the wheel.

--tom
-- 
F u cn rd ths u cnt spl wrth a dm!


------------------------------

Date: 17 Apr 1999 15:59:37 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: why won't this statement work @array=<*.*>
Message-Id: <7fab59$7os$1@gellyfish.btinternet.com>

On 16 Apr 1999 11:53:58 -0700 Tom Christiansen wrote:
> In comp.lang.perl.misc, 
>     Jonathan Stowe <gellyfish@gellyfish.com> writes:
> :If all else fails :
> :
> :opendir(DIR,'.') || die "aieee - $!\n";
> :@array = readdir(DIR);
> :closedir(DIR);
> 
> It's true that some ports have broken implementations of glob().
> One should spend time fixing them instead of making everyone
> go to the same idiotic pain.
> 

Actually it appears from a number of recent posts that glob() is broken
particularly on NT as opposed to '98 or '95 - and whilst I wonder at little
about the peculiarities of these (ahem) platforms - is there anyone who
might cast some light on why this might be so ?

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


------------------------------

Date: Sat, 17 Apr 1999 09:47:50 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Would anyone care to teach me perl?
Message-Id: <6e3af7.7db.ln@magna.metronet.com>

ggs (gs_london@yahoo.com) wrote:
: Lesson One

: -------start------
: #!/usr/bin/perl
: ------end-------
: put the above in a file and save it. (filename= lesson_one.pl)


   Lesson One has a bug in it. See the BUGS section in the
   top level perl manpage (perl.pod).

   A bug in the very first lesson does not inspire confidence
   in any lessons to follow...

   
: come back next month for Lesson Two (or buy a book)


   Don't come here for lessons. You have no way to evaluate
   the teacher's credentials.

   They may teach broken stuff.

   You have access to thousands of "pages" of documentation
   written and maintained by the people who provide the
   perl compiler/interpreter itself.

   Much more trustworthy source of Perl (or perl) information.

   perlrun.pod explains shebang lines.


: Raymond Yu wrote in message <371513C8.3CD3086C@nettaxi.com>...
: >Would anyone care to teach me perl?  Just with email though.


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


------------------------------

Date: 17 Apr 1999 15:34:03 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: zipped perlman
Message-Id: <7fa9lb$7np$1@gellyfish.btinternet.com>

On Fri, 16 Apr 1999 16:01:44 -0400 Lanny Gilbert wrote:
> Jeff Thies wrote:
> 
>>   I'm a windows user and would like to have the perl man local. Is there
>> a zipped version? I can find the tarred version.
>>
> 
> You can "untar" the perl man file using the WinZip utility, which you
> probably
> already have. Just make sure that if it's a tar file that the file has a
> ".tar" extension
> and if it's a zipped tar file, it has the ".tar.Z" extension.
> 

No.  The .Z extension is for a 'compress'ed file on which you use 'uncompress'
a zipped file may have the extension of .zip or .gz if using gnu zip.  I
am not sure whether WinZip will uncompress a .Z file but will do gzipped
tar files.

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


------------------------------

Date: Sat, 17 Apr 1999 10:00:46 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: { } question/problem
Message-Id: <e64af7.7db.ln@magna.metronet.com>

David Walford (davewal@echo.corp.sgi.com) wrote:

: I am not sure the information below is helping me or maybe I am not
: understanding how it is applied.


   Here it is in plain language.

   Do not do what you are trying to do.

   It can introduce bugs that are exceedingly hard to chase down.


: I am not trying to assign a variable with a variable.


   Yes you are.


: I have a bunch of arrays with titles like "name_array, date_array, time_array".


   It would be better, safer, and more maintainable to use a hash
   of (references to) arrays instead.

   $info{name} = [ 'somename', 'someothername' ];
   $info{date} = [ 'somedate', 'someotherdate ];
   $info{time} = [ 'sometime', 'someothertime ];

   See 'perlref.pod' and 'perldsc.pod' for info on how to do
   complex data structures in Perl.


: I would like to use a variable to define the first part of the arrays title for
: a subroutine to use the appropriate array.


   You may think that you would like to, but more experienced folks
   will feel compelled to tell you that you shouldn't want to do
   that.

   There is a better and safer way to get the effect you describe.

   See:

         http://www.plover.com/~mjd/perl/varvarname.html

   for a discussion of why we keep saying that you should not
   do what you are trying to do.


: This was my example:
: for (sort keys %${tag}_array )  <-- But this doesn't work.
                 ^^^^^^

   What you are attempting can be done with "Symbolic References"
   (see that heading in 'perlref.pod').

   But again, you don't want to use symbolic references.

   That was a convenient way to get the kind of thing that you
   want in Perl 4.  Perl 5 added references, so there is a
   much much better way to do it nowadays.




: In article <3717848d@cs.colorado.edu>, Tom Christiansen <tchrist@mox.perl.com>
: writes:
: |>  [courtesy cc of this posting sent to cited author via email]
: |> 
: |> In comp.lang.perl.misc, davewal@echo.corp.sgi.com (David Walford) writes:
: |> :How do I call up an array that has a name which is built with a variable?
: |> 
: |> You don't.  Stop using the package symbol table as an ersatz hash.
: |> Use your own.
: |> 
: |> --tom
: |> 
: |> =head2 How can I use a variable as a variable name?
: |> 
: |> Beginners often think they want to have a variable contain the name
: |> of a variable.
: |> 
: |>     $fred    = 23;
: |>     $varname = "fred";
: |>     ++$$varname;         # $fred now 24
: |> 
: |> This works I<sometimes>, but it is a very bad idea for two reasons.
: |> 
: |> The first reason is that they I<only work on global variables>.
: |> That means above that if $fred is a lexical variable created with my(),
: |> that the code won't work at all: you'll accidentally access the global
: |> and skip right over the private lexical altogether.  Global variables
: |> are bad because they can easily collide accidentally and in general make
: |> for non-scalable and confusing code.
: |> 
: |> Symbolic references are forbidden under the C<use strict> pragma.
: |> They are not true references and consequently are not reference counted
: |> or garbage collected.
: |> 



--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


------------------------------

Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V8 Issue 5406
**************************************

home help back first fref pref prev next nref lref last post