[9229] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2824 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jun 9 18:07:22 1998

Date: Tue, 9 Jun 98 15:00:29 -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           Tue, 9 Jun 1998     Volume: 8 Number: 2824

Today's topics:
    Re: 'fork' on x86 port of Perl (Ilya Zakharevich)
    Re: [EUREKA] Yes, I think it is (was Re: No, It's Not ( <Russell_Schulz@locutus.ofB.ORG>
    Re: Animated gifs question ... <postmaster@castleamber.com>
    Re: Associative Array Keys - Names ptimmins@netserv.unmc.edu
        CALCULATING DATE RANGES (WELLINGTON APARTMENT)
        Can't find B::FM package in Perl Compiler dmea11@ibm.net
    Re: Certified Perl Programmers (Joel Coltoff)
    Re: Certified Perl Programmers (Charles DeRykus)
    Re: Certified Perl Programmers <tchrist@mox.perl.com>
    Re: Certified Perl Programmers <merlyn@stonehenge.com>
        Command line substitution thru subdirectories <roklan_r@code80.npt.nuwc.navy.mil>
    Re: Command line substitution thru subdirectories <tchrist@mox.perl.com>
    Re: Date Manipulation ptimmins@netserv.unmc.edu
    Re: Eval questions. (Charles DeRykus)
    Re: Latest Perl Version (was Re: Field order from a Web (Jonathan Stowe)
        Need to plot charts (gif format ?) from ascii data (Vinit Jindal)
    Re: Package Question -- How can I circularly include? <postmaster@castleamber.com>
    Re: Package Question -- How can I circularly include? (Ilya Zakharevich)
    Re: pass the gravy and the hashref, please (Mark-Jason Dominus)
    Re: Perl Books? ptimmins@netserv.unmc.edu
    Re: print <<EOT; problems <Russell_Schulz@locutus.ofB.ORG>
    Re: print <<EOT; problems <tchrist@mox.perl.com>
        Q? "print" directly to printer? <NOSPAMbfritz@spry.com>
    Re: Question about =~ <postmaster@castleamber.com>
    Re: Reading Directories <postmaster@castleamber.com>
    Re: sendmail on NT IIS4 <NOSPAMbfritz@spry.com>
    Re: using a variable as a variable name? (Kelly Hirano)
    Re: using a variable as a variable name? (Abigail)
    Re: using a variable as a variable name? (Larry Rosler)
    Re: using a variable as a variable name? <tchrist@mox.perl.com>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 9 Jun 1998 20:59:25 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: 'fork' on x86 port of Perl
Message-Id: <6lk7nd$t5k$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Shaun Jackman 
<sjackman@rogers.wave.ca>],
who wrote in article <357CDCB3.EA325C3@rogers.wave.ca>:
> The fork function crashes with
> "The Unsupported function fork function is unimplemented"
> upon use.
> 
> Is there an implementation of fork avaiable for the x86?

Sure.  The standard DOSISH implementation (EMX port) can fork().
So can (I think) dgcpp (sp?) port.

Look under ports/os2 (but it works with DOS/Win* too).

Ilya


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

Date: Tue, 9 Jun 1998 21:49:50 +0100
From: Russell Schulz <Russell_Schulz@locutus.ofB.ORG>
Subject: Re: [EUREKA] Yes, I think it is (was Re: No, It's Not (was Re: Yes, it is))
Message-Id: <19980609.214950.2g7.rnr.w164w@locutus.ofB.ORG>

jdporter@min.net (John Porter) quotes me and writes:

>> I wonder if the original `Yes it is' was misposted
>
> I didn't make the connection at the time.  I shouldn't have to

yes, that's what `misposted' means.

> the fool didn't followup, he posted a brand new message.

if you think being a newbie is enough to make you a fool, you haven't
encountered extreme enough fools.  it takes a LOT more than that.
-- 
Russell_Schulz@locutus.ofB.ORG  Shad 86c


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

Date: 9 Jun 1998 20:45:14 GMT
From: "John Bokma" <postmaster@castleamber.com>
Subject: Re: Animated gifs question ...
Message-Id: <01bd93e7$d8f7f860$02521e0a@tschai>



Joe Halbrook <joe@halbrook.com> wrote in article
<357D3D51.45D6@halbrook.com>...
> I've come across a strange occurrence:
> 
> I load a rotating image via a Perl script:
> 
> <IMG SRC="http://www.my.server.com/cgi-bin/image.pl?A4993948585" ...>
> 
> When the image is not animated, all is fine.  But, when the image is an
> animated gif, it only runs thru the first iteration of the animation,
> then stops.  Why doesn't it loop continuously, like it does when I
> replace the above line with:

Do you run it on a DOS/NT machine? Do you send the bytes of the GIF
yourself? Do you use binmode in that case? Not? Ooops...

Why don't you use:

print "Location: http://www.your.server.com/youranimated.gif\n\n";

Regards,

John


-- 
------------------------------------------------------------------
C A S T L E  A M B E R      Software Development (Java/Perl/C/CGI)
http://www.castleamber.com/ john@castleamber.com

NEW: http://www.binaries.org/ Guide to Program Binaries & Pictures



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

Date: Tue, 09 Jun 1998 19:54:38 GMT
From: ptimmins@netserv.unmc.edu
Subject: Re: Associative Array Keys - Names
Message-Id: <6lk3tu$hsg$1@nnrp1.dejanews.com>

In article <357D5AD2.183582D0@bentley.com>,
  William Goerlich <intern.bill.goerlich@bentley.com> wrote:
>
> I want to retrieve the value from an associative array which has a key
> that has spaces in it.
>
> ex:
> $value = $junk{internet technology group};
>
> this doesn't work, it gives the error:
[snip]
> My question is why and how do I fix it.
>
> Thanks alot!
>
> Bill
>
>

Put a quote around the key, both when loading the hash, and when reading from
it. eg:

%junk = ('internet technology group' => "i.t.g",
         1 => 2,
        );
print "$junk{'internet technology group'}\n";
print "$junk{1}\n";

will print out:
i.t.g
2

Patrick Timmins
U. Nebraska Medical Center



-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

Date: 9 Jun 1998 20:58:56 GMT
From: wllngton@netins.net (WELLINGTON APARTMENT)
Subject: CALCULATING DATE RANGES
Message-Id: <slrn6nr8gg.p05.wllngton@worf.netins.net>

Can anyone help me with this problem?  I want to calculate some dates
based on someone entering a date like 6/9/98 and telling it to pull up
information based on the last 4 days... so it figures out that 1 day
ago was 6/8/98 and two days ago was 6/7/98, etc.


Thanks!

Dave


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

Date: Tue, 09 Jun 1998 14:11:05 -0700
From: dmea11@ibm.net
Subject: Can't find B::FM package in Perl Compiler
Message-Id: <357DA4E9.F9F@ibm.net>

I'm trying to use the Perl compiler one a Perl script I wrote that takes
about 4 hours to run.  When I run the compiler, it says the syntax is ok
but then gives me the following error:

Uncaught exception from user code:
Can't locate object method "save" via package "B::FM" at 
/usr/local/lib/perl5/sun4-solaris/5.00404/B/C.pm line 672.

I have gotten the compiler to work on simpler Perl files, but this one
kills it.

I've looked all over for that package but I can't find it anywhere.  Any
help would be greatly appreciated.

Thanks.

Randy
e-mail: seligman@dmea.osd.mil


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

Date: Tue, 9 Jun 1998 20:31:08 GMT
From: joel@wmi0.wmi.com (Joel Coltoff)
Subject: Re: Certified Perl Programmers
Message-Id: <6lk61i$jjj@netaxs.com>
Keywords: Flemish foggy plagiarism prize

In article <6lk40e$55p@news-central.tiac.net>,
Mike Stok <mike@stok.co.uk> wrote:
>In article <6lk05p$9h3$1@monet.op.net>, Mark-Jason Dominus <mjd@op.net> wrote:
>
>
>Are you willing to certify "perl engineers"?  I've always wanted to be an
>engineer ;-)

I think we need to be more formal about this. We find a perl goddess
and on a periodic basis she taps the qualified recipients on each shoulder
with her scimitar and dubs them "Lord High Programmer, Certified Perl
Engineer, Keeper Of the Faith, Grand Poobah Of Grep, User of Map In
A Non-Void Context" A certificate suitable for placing at the bottom of
a bird cage is then presented. This is followed by cocktails and dinner.
Black tie is optional.

-- 
Joel Coltoff

I'd explain it, but there's a lot of math. -- Calvin


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

Date: Tue, 9 Jun 1998 20:41:31 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: Certified Perl Programmers
Message-Id: <EuAxH7.9p4@news.boeing.com>
Keywords: Flemish foggy plagiarism prize

In article <6lk05p$9h3$1@monet.op.net>, Mark-Jason Dominus <mjd@op.net> wrote:
>In article <896499799.810661@thrush.omix.com>,
>Zenin  <zenin@bawdycaste.org> wrote:
>>	Certifications are only good for pointy hair managers.  Anyone with
>>	half a clue know they are worth less then the paper they are printed
>>	on.
>
>I agree.  But this brings up a worry for me.
>
>Suppose someone ere to go into the business of certifying Perl
>programmers.  Than I might one day be forced to pay out my hard-earned
>money to get a certification from someone who knows much less than I
>do.  I don't like that idea.  And it could happen any time.  But how
>can I prevent it?
>
>By stealing the certifications in advance, that's how.  I've declared
>myself to be a Perl cerifying authority.  I have put `certified Perl
>developer' on my resume.  If anyone ever starts selling
>certifications, and some optential employer asks if I'm certified, I'm
>set.  ``Oh, yes.  I've been a certified Perl developer since 1997.''
>
>I encourage everyone else to do this too.  You can certify yourself,
>or you can send email to mjd-perl-certification@plover.com to request
>a certification, which I will send.  Then you can bill yourself as a
>`Plover Systems Certified Perl Programmer' or just `Certified Perl
>Programmer'.  I encourage the latter---it would be bad if there was
>some way to distinguish free certifications from the kind you have to
>pay for.
>
>Of course, this wouldn't work if certifications were really worth
>anything---but they aren't.  But middle management operates by
>appearances, not realities, and a free Plover Systems Certification
>has as much appearance as one that you had to pay money for.
>
>I've been thinking that if some people need physical certificates, I
>could print some up and supply them for a nominal fee, maybe $2.  It
>gives me the willies to take any money at all for certifications, but
>it might be for the greater good.  I guess I'll do it if it becomes
>necessary, or maybe I'll give some out for free at the Perl
>Conference.
>
>So get certified now, because the more Certified Perl Programmers
>there are, the more difficult it'll be for someone to set up a company
>to take your money for certifications.  Send mail to
>mjd-perl-certification@plover.com, and be sure to say what you want to
>be certified as.
>
>I think a preemptive strike could be very effective here.
>

"Plover Systems Certified...".  Nah.  

Perhaps though the Perl Institute could issue a certificate. 
The only requirement would be whatever Tom Christiansen 
deemed proof of ability to read :) 


--
Charles DeRykus


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

Date: 9 Jun 1998 20:55:28 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Certified Perl Programmers
Message-Id: <6lk7g0$hgb$2@csnews.cs.colorado.edu>
Keywords: Flemish foggy plagiarism prize

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

In comp.lang.perl.misc, joel@wmi0.wmi.com (Joel Coltoff) writes:
:I think we need to be more formal about this. We find a perl goddess
:and on a periodic basis she taps the qualified recipients on each shoulder
:with her scimitar and dubs them "Lord High Programmer, Certified Perl
:Engineer, Keeper Of the Faith, Grand Poobah Of Grep, User of Map In
:A Non-Void Context" A certificate suitable for placing at the bottom of
:a bird cage is then presented. This is followed by cocktails and dinner.
:Black tie is optional.

We could ask Elizabeth Zwicky whether she would please be our goddess.
It's been done before.

--tom
-- 
    "This sentence no verve." --Larry Wall


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

Date: Tue, 09 Jun 1998 21:24:47 GMT
From: Randal Schwartz <merlyn@stonehenge.com>
Subject: Re: Certified Perl Programmers
Message-Id: <8c3edes1yh.fsf@gadget.cscaper.com>

>>>>> "Charles" == Charles DeRykus <ced@bcstec.ca.boeing.com> writes:

Charles> Perhaps though the Perl Institute could issue a certificate. 
Charles> The only requirement would be whatever Tom Christiansen 
Charles> deemed proof of ability to read :) 

Actually, at some of the early TPI meetings, we talked about "TPI
certification".  Don't say it won't happen.  But it's not on the
active to-do list just right now.

print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,990.69 collected, $186,159.85 spent; just 83 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


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

Date: Tue, 09 Jun 1998 17:11:05 -0400
From: Bob Roklan <roklan_r@code80.npt.nuwc.navy.mil>
Subject: Command line substitution thru subdirectories
Message-Id: <357DA4E9.DA495FD6@code80.npt.nuwc.navy.mil>

 I am running Perl 5.003 on Windows 95. I would like to specify a
substitution string for multiple files spanning specified directory and
its subdiredirectories.

I know that the following would work for the current directory....

    perl -i.old -p -e "s/foo/bar/g" *.htm

but how can I tell perl to do the same for a specified directory and
down?

Info would be greatly appreciated. While I am here can I ask another
question? Ok, thanks. Does anyone know of a news server where I can at
least read comp.lang.perl.misc thru a news reader? Ours does not allow
you to search subjects.



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

Date: 9 Jun 1998 21:48:33 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Command line substitution thru subdirectories
Message-Id: <6lkajh$lki$2@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, 
    Bob Roklan <roklan_r@code80.npt.nuwc.navy.mil> writes:
:    perl -i.old -p -e "s/foo/bar/g" *.htm
:
:but how can I tell perl to do the same for a specified directory and
:down?

Use the Shell, Bob.

    % perl -i.orig -pe 's/\bfoo\b/bar/g' `find / -name '*.htm' -print`

--tom
-- 
Build a system that even a fool can use, and only a fool will want to use it.


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

Date: Tue, 09 Jun 1998 21:08:21 GMT
From: ptimmins@netserv.unmc.edu
Subject: Re: Date Manipulation
Message-Id: <6lk884$nof$1@nnrp1.dejanews.com>

In article <MPG.fe70dc820dfd7dd989686@nntp.hpl.hp.com>,
  lr@hpl.hp.com (Larry Rosler) wrote:
>
[snip]
>
> Each of your snippets could benefit from a little polish, or at least
> another way to think about expressing the ideas, all of which are
> acceptable (and a lot more desirable -- to me -- than using one of the
> large Date modules).
[snip]
> An array is more natural than a hash here.  Either index by $temp_month -
> 1, or prepend a dummy zeroth array element.  A leading zero in
> $temp_month becomes irrelevant.
>
> @month = qw( January February March April May June July August September
>     October November December );
>
[snip]
> Not all problems need to be solved by regexes.
>
> $year = $temp_year + ($temp_year < 10 ? 2000 : 1900);
>
[snip]
> Not all problems need to be solved by regexes.
>
> $day = $temp_day + 0;
>
> There.  All that should save some paper, or at least some screen space.
> :-)
>
> --
> Larry Rosler
> Hewlett-Packard Laboratories
> lr@hpl.hp.com
>

All very good. I *am* stuck on regexes. Can you tell I bought Jeffrey Friedl's
Mastering Regular Expressions? :)

To the original poster: do like Larry Rosler suggests:

@month = qw( January February March April May June July August September
October November December );
while (<>) {
    if (/^(\d{2})(\d{2})(\d{2})/) {
        ($temp_year, $temp_month, $temp_day) = ($1, $2, $3);
        $year = $temp_year + ($temp_year < 10 ? 2000 : 1900);
        $day = $temp_day + 0;
        print "$day $month[$temp_month-1] $year\n";
    }
}

Patrick Timmins
U. Nebraska Medical Center

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

Date: Tue, 9 Jun 1998 20:26:06 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: Eval questions.
Message-Id: <EuAwrI.8KG@news.boeing.com>

In article <01bd93d1$ac777600$02521e0a@tschai>,
John Bokma <john@castleamber.com> wrote:
 > Hi,
 > 
 > I want to use a tekstfile to define macro's and expand macro's
 > based on Perl.
 > 
 > Example:
 > 
 > \
 > sub somesub ($)
 > {
 >    my ($var) = shift;
 > 
 >    return $var;
 > }
 > 
 > "";
 > \
 > 
 > \somesub("Expand me")\
 > 
 > the \somesub("Expand me")\ is replaced by
 > Expand me.
 > 
 > I have this already working using:
 > 
 > s/\\([^\\]+\\/ eval $1 ./ meg;
 > 

Hm, perl contradicts you:

   perl  -e 's/\\([^\\]+\\/ eval $1 ./ meg;'
   /\\([^\\]+\\/: unmatched () in regexp at -e line 1.


--
Charles DeRykus


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

Date: Tue, 09 Jun 1998 21:36:46 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: Latest Perl Version (was Re: Field order from a Web Server)
Message-Id: <357d9872.1028855@news.btinternet.com>

On Mon, 8 Jun 1998 23:58:40 -0400, Ronald J Kimball wrote :

>Jonathan Stowe <Gellyfish@btinternet.com> wrote:
>
>> I would seriously recommend upgrading that Perl - the latest
>> "standard" distribution is at 5.004.02. 
>
>I believe you mean 5.004_04.  Looks like he's not the only one who needs
>to upgrade.  :-)
>
The brain first and then the OS on those benighted computers - of
course I meant the "standard" binary distribution for Win32.

/J\
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>



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

Date: 9 Jun 1998 20:38:46 GMT
From: vjindal@qualcomm.com (Vinit Jindal)
Subject: Need to plot charts (gif format ?) from ascii data
Message-Id: <6lk6gm$dvs$1@thefuture.qualcomm.com>


Hello,

I am writing Perl scripts that query Oracle database for data,  and
then plot charts from that data.  These charts would then be posted on 
the web.

Is there a freeware / shareware utility available that I can use to
plot charts from ascii data.

Any other suggestions for posting charts on the web prepared from 
ascii data.

Thanks,

--

Vinit Jindal
vjindal@qualcomm.com

--


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

Date: 9 Jun 1998 20:47:39 GMT
From: "John Bokma" <postmaster@castleamber.com>
Subject: Re: Package Question -- How can I circularly include?
Message-Id: <01bd93e8$2eac9540$02521e0a@tschai>



F.Quednau <quednauf@nortel.co.uk> wrote in article
<357D45C2.CB9523F9@nortel.co.uk>...
> Nicholas Konidaris wrote:
> 
> > What am I doing wrong?
> 
> You should possibly have a look in the inheritance section of the
> perltoot pages.

Or scratch your head and kick the computer :-)

(Same quality of reply)

John


-- 
------------------------------------------------------------------
C A S T L E  A M B E R      Software Development (Java/Perl/C/CGI)
http://www.castleamber.com/ john@castleamber.com

NEW: http://www.binaries.org/ Guide to Program Binaries & Pictures



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

Date: 9 Jun 1998 21:01:36 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Package Question -- How can I circularly include?
Message-Id: <6lk7rg$dj$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Tom Christiansen 
<tchrist@mox.perl.com>],
who wrote in article <6ljf4p$gk4$1@csnews.cs.colorado.edu>:
> The only case where mutual inclusions will be a problem is if Alpha were
> to try to call something in Beta during compile time initialization. (Or
> Beta call Alpha).  I'm talking about this kind of thing, which doesn't
> work:
> 
>     ==> Alpha.pm <==
>     package Alpha;
>     use Beta;
>     sub func { print "Alpha::func called\n" }
>     $x = Beta::func();
>     print "Alpha done.\n";
>     1;
> 
>     ==> Beta.pm <==
>     package Beta;
>     use Alpha;
>     sub func { print "Beta::func called\n" }
>     $x = Alpha::func();
>     print "Beta done.\n";
>     1;
> 
> The solution to this is to employ require, maybe with an import.

Or - most of the time - just to reorder `use Blah' directives
appropriately, putting them as late in file as possible.

Ilya


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

Date: 9 Jun 1998 17:35:08 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: pass the gravy and the hashref, please
Message-Id: <6lk9qc$ase$1@monet.op.net>
Keywords: Fayette sole Sullivan Tomlinson

In article <357C8FE5.94CC1AF4@intes.net>,
Chris Winters  <cwinters@intes.net> wrote:
>
>Then I have a sneaky thought: what if I instantiated the children with
>a reference to the parent, which happened to be an empty hashref. Then
>I could fill in the parent's values at the very last second and have
>the children automatically see them.
>
>However, this doesn't work.

What you want is possible, but you must have done it wrong.  WIthout
seeing the broken code, it's hard to say what the matter is.  I'll try
to guess.

But first let me point out that the example you showed is already
doing what you say you want.  You needn't initialize $parent->{values}
at the beginning; you can initialize it at the end, and the children
will see the changes.

Something like this:

	$self->{values} = {};
	$self->{elements}[$element_num] 
	  = Element->new(values => $self->{values});

	# Child values now refer to same empty hash as $self values

Now you want to assign $self->{values} and have the results appear in
the children too.  That's a little tricky, and maybe it's where yur
problem is coming from.  You can't do this:

	$self->{values} = { foo => 'dizzy' , ... }  

because that makes $self->{values} refer to a *new* anonymous hash,
instead of modifying the currently-empty one that the children are
referring to.  Instead, you need

	%{$self->{values}} = ( foo => 'dizzy' , ... )

which will store *into* the *referred-to* hash, which is shared by the
children.


A simpler approach might be to just give the children a pointer back
to the entire parent:

	$self->{elements}[$element_num] 
	  = Element->new(parent => $self);

Then the child can use $self->{parent}{values} to get the parent's
values; that's less obscure.



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

Date: Tue, 09 Jun 1998 20:26:56 GMT
From: ptimmins@netserv.unmc.edu
Subject: Re: Perl Books?
Message-Id: <6lk5qf$kdu$1@nnrp1.dejanews.com>

In article <6ljlgt$pf1$1@taliesin.netcom.net.uk>,
  The Dukester <web1@netcomuk.co.uk> wrote:
>
> Dear All,
> 	I'm in the UK and was wondering if anyone could suggest a good Perl
book, which  would be able to get my head around (I've done
> basic, little bits of C+ and assembly) and use as a refernce guide? I wouldn't
want to spunk #50 on rubbish.
> Many thanks
[snip]
> Luke
>

Try O'Reilly and Assoc at www.oreilly.com

Learning Perl, 2nd Edition (Schwartz, Christiansen, and Wall)
Programming Perl, 2nd Edition (Wall, Christiansen, and Schwartz)

"Learning ..." is intro, 302 pp, $29.95 American
"Programming ..." is the main reference, 670 pp, $39.95 American

As of late 6/8/98 New York was trading $1 at #0.612, so you could get both
books for about #43 (plus shipping and handling, of course).

Patrick Timmins
U. Nebraska Medical Center

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

Date: Tue, 9 Jun 1998 21:43:00 +0100
From: Russell Schulz <Russell_Schulz@locutus.ofB.ORG>
Subject: Re: print <<EOT; problems
Message-Id: <19980609.214300.0m4.rnr.w164w@locutus.ofB.ORG>

tchrist@mox.perl.com (Tom Christiansen) writes:

>>   print <<EOT;
>>      testing
>>      EOT
>
>> "Can't find string terminator "EOT" anywhere before EOF at <path>."
>
> This is described in the standard perldata manpage shipped with
> every installation of Perl.  It's on your system.  Just look it up.
> It's quite clear.

how hard would it be, when this happens, for the interpreter to give
the helpful hint (not fix it, just add it into the warning) that there
WAS an indented line with "EOT" in it?  (indented or not, maybe.)
-- 
Russell_Schulz@locutus.ofB.ORG  Shad 86c


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

Date: 9 Jun 1998 21:46:17 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: print <<EOT; problems
Message-Id: <6lkaf9$lki$1@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, 
    Russell Schulz <Russell_Schulz@locutus.ofB.ORG> writes:
:how hard would it be, when this happens, for the interpreter to give
:the helpful hint (not fix it, just add it into the warning) that there
:WAS an indented line with "EOT" in it?  (indented or not, maybe.)

Patches are always welcome.

--tom
-- 
    Perl is designed to give you several ways to do anything, so
    consider picking the most readable one.
            --Larry Wall in the perl man page


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

Date: Tue, 09 Jun 1998 14:53:05 -0700
From: Brian Fritz <NOSPAMbfritz@spry.com>
Subject: Q? "print" directly to printer?
Message-Id: <357DAEC1.78378D83@spry.com>

I'm working on a script that is intended to format text files and 
print them directly to the printer. This script will be used on both NT
(Win32) and Linux platforms.

I didn't find any examples in my books, FAQs, and my two favorite Perl 
Wizards didn't know how to open a file handle to a printer either.

Is there a way to open a file handle that is assigned to a parallel 
port for output?

TIA,

Brian

-- 
>>>
>>> Email reply to: bfritz@spry.com


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

Date: 9 Jun 1998 20:49:49 GMT
From: "John Bokma" <postmaster@castleamber.com>
Subject: Re: Question about =~
Message-Id: <01bd93e8$7d3eb800$02521e0a@tschai>



Ala Qumsieh <aqumsieh@matrox.com> wrote in article
<357D4041.1313AF66@matrox.com>...
> Keppy Boone wrote:
> 
> > I am having some difficulty getting a search to work given a string.
> >
> > ex.
> >
> > $_ =~ /look/i;    # works fine.
> 
> Just a note:When referring to the default $_ variable, you can simply
> write:
> 
> /look/i;
> 
> > $search = "/look/i";
> > $_ =~ $search;    #Doesn't work.
> >
> > Charles Boone
> 
>  You can use eval():

or, AFAIK,

$search = "look"
$_ =~ /$search/i;

When using eval it is most of the times better to put more
inside it (i.e. the whole loop, assuming that you are going
to use a loop)

John


-- 
------------------------------------------------------------------
C A S T L E  A M B E R      Software Development (Java/Perl/C/CGI)
http://www.castleamber.com/ john@castleamber.com

NEW: http://www.binaries.org/ Guide to Program Binaries & Pictures



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

Date: 9 Jun 1998 20:52:04 GMT
From: "John Bokma" <postmaster@castleamber.com>
Subject: Re: Reading Directories
Message-Id: <01bd93e8$cd7da060$02521e0a@tschai>



dukeboy77@my-dejanews.com wrote in article
<6lji10$nc3$1@nnrp1.dejanews.com>...
> I need a script that will search a directory read the name of every file
> and put it into an array called @files.  I've tried and tried with no
success
> and had no idea where else to turn.  If someone could help me I would be
very
> greatful.  Thank you.

open(DIR, "/your/directory") or die "Can't open /your/directory";
my @files = grep(!/^\.\.?/, readdir(DIR));
closedir(DIR);

the grep excludes the . and .. from the list. If you really want files
only, add
use grep(-f $_, readdir(DIR)); instead (. and .. are not files :-)

John


-- 
------------------------------------------------------------------
C A S T L E  A M B E R      Software Development (Java/Perl/C/CGI)
http://www.castleamber.com/ john@castleamber.com

NEW: http://www.binaries.org/ Guide to Program Binaries & Pictures



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

Date: Tue, 09 Jun 1998 14:40:01 -0700
From: Brian Fritz <NOSPAMbfritz@spry.com>
To: angst <angst@scrye.com>
Subject: Re: sendmail on NT IIS4
Message-Id: <357DABB1.9A74D0F7@spry.com>

angst wrote:
> 
> Don Bayless <donbay@gte.net> wrote:
> : Just what would one put in place of this on an NT box running IIS4??
> 
> : #!/usr/local/bin/perl
> : $mail_prog = '/usr/lib/sendmail' ;
> 
> The name of a command-line mailer written for NT.  AFAIK, NT doesn't come with
> one.  Some NT MTA's come with one.  Either way, the question has nothing
> to do with perl, it has to do with command-line mailers.  You might want
> to try an NT group, and ask about command-line mailers for NT.
> HTH!
> 

If you have access to an SMTP mailer you can use "blat" which you can
get at:
http://gepasi.dbs.aber.ac.uk/softw/Blat.html

If you need something that works with exchange... That's a different
critter.

Brian

-- 
>>>
>>> Email reply to: bfritz@spry.com


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

Date: 9 Jun 1998 13:14:09 -0700
From: hirano@Xenon.Stanford.EDU (Kelly Hirano)
Subject: Re: using a variable as a variable name?
Message-Id: <6lk52h$fj1@Xenon.Stanford.EDU>

In article <6lk35l$gt0$1@nnrp1.dejanews.com>,  <lindali@my-dejanews.com> wrote:
>        while ( ($varname,$code) = each(%code) ) {
>
>            if ( $f eq $code ) {  # if criteria matches code
>               $$varname = $d;   # assign corresponding value to the variable
>            }
>        }
>
>for example, if the program reads in :   Test  3521
>then $varname = Test  and $numid = 3521
>then $code{"Test"} = 3521
>
>so if $f happens to equal 3521, then i'd like to assign
>$Test = $d;

try ${$varname} -- you can actually put anything you want into the {}'s for a
var name, e.g. ${$varname . '_data'} or something.
-- 
Kelly William Hirano	                    Stanford Athletics:
hirano@cs.stanford.edu	                 http://www.gostanford.com/
hirano@alumni.stanford.org      (WE) BEAT CAL (AGAIN)! 100th BIG GAME: 21-20


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

Date: 9 Jun 1998 20:38:28 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: using a variable as a variable name?
Message-Id: <6lk6g4$2ve$1@client3.news.psi.net>

lindali@my-dejanews.com (lindali@my-dejanews.com) wrote on MDCCXLIII
September MCMXCIII in <URL: news:6lk35l$gt0$1@nnrp1.dejanews.com>:
++ Please excuse if this is a trivial question, i'm fairly new to Perl...
++ 
++ 
++ reading in and storing the values hasn't been a problem.  it's later, when i
++ want to use that information to compare and assign a new value to a variable:
++ (see code below)
++ 
++         while ( ($varname,$code) = each(%code) ) {
++ 
++             if ( $f eq $code ) {  # if criteria matches code
++                $$varname = $d;   # assign corresponding value to the variable
++             }
++         }
++ 
++ 
++ however, i have a feeling that this isn't allowed in Perl
++ is there some other way this can be done?


It is. It is called 'soft references'. It is usually not recommended,
and "use strict 'refs';" will generate an error if you try.

perlref has more details.



Abigail
-- 
perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\n";'


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

Date: Tue, 9 Jun 1998 13:53:12 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: using a variable as a variable name?
Message-Id: <MPG.fe74095dab58055989688@nntp.hpl.hp.com>

In article <6lk52h$fj1@Xenon.Stanford.EDU>, hirano@Xenon.Stanford.EDU 
says...
> In article <6lk35l$gt0$1@nnrp1.dejanews.com>,  <lindali@my-dejanews.com> wrote:
> >        while ( ($varname,$code) = each(%code) ) {
> >
> >            if ( $f eq $code ) {  # if criteria matches code
> >               $$varname = $d;   # assign corresponding value to the variable
> >            }
> >        }
 ...
> try ${$varname} -- you can actually put anything you want into the {}'s for a
> var name, e.g. ${$varname . '_data'} or something.

True, but $$varname and ${$varname} are identical.  The code should work 
as written.

-- 
Larry Rosler
Hewlett-Packard Laboratories
lr@hpl.hp.com


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

Date: 9 Jun 1998 20:54:23 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: using a variable as a variable name?
Message-Id: <6lk7dv$hgb$1@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, 
    lindali@my-dejanews.com writes:
:        while ( ($varname,$code) = each(%code) ) {
:            if ( $f eq $code ) {  # if criteria matches code
:               $$varname = $d;   # assign corresponding value to the variable
:            }
:        }

Why would you want to do that?  Why wouldn't you want

    $some_other_hash{$varname} = $d;

I never trust people wanting to set variables *by name* like this.
By-name access is the proper domain of a hash.

--tom
-- 
*** The previous line contains the naughty word "$&".\n
                if /(ibm|apple|awk)/;      # :-)
            --Larry Wall in the perl man page


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

Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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.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 2824
**************************************

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