[11736] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5336 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Apr 9 02:07:27 1999

Date: Thu, 8 Apr 99 23: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           Thu, 8 Apr 1999     Volume: 8 Number: 5336

Today's topics:
    Re: Adding to @INC <carton.lao@home.com>
    Re: better way to write this script ? (Ronald J Kimball)
    Re: Danger!  Near-clueless newbie with a technical ques (Ronald J Kimball)
    Re: Help with a basic problem! (Ronald J Kimball)
    Re: HELP with Subsitution (Larry Rosler)
    Re: HELP with Subsitution (Sam Holden)
    Re: Help! Missing first line..... (David Efflandt)
    Re: HELP!!  ON  STRING COMPARING (Ronald J Kimball)
        Hotmail's Homepages <patfong@yoyo.cc.monash.edu.au>
    Re: How do I turn this 1000000 into this 1,000,000 in P <uri@home.sysarch.com>
        Latest AdminMisc and ActiveState's perl (Andrew Haveland-Robinson)
    Re: minimal pattern matching (Ronald J Kimball)
        Perl source for ps on NT <tsouk@intx.net>
    Re: pragma - The cgi is written in perl <elssa09@callisto.si.usherb.ca>
        pragma <elssa09@callisto.si.usherb.ca>
    Re: pragma (Sam Holden)
    Re: Problem viewing PERL data in browser (Ronald J Kimball)
    Re: Quantum Variable <aperrin@mcmahon.qal.berkeley.edu>
    Re: Quantum Variable (Ronald J Kimball)
    Re: random number ( -w ) <dgris@moiraine.dimensional.com>
        Returning "undef" from a subroutine. Appears broken in  <tbutler@rational.com>
    Re: SORT BY DATE <gnat@frii.com>
    Re: Stat::mode? bitwise operator? (Ronald J Kimball)
    Re: stumped on regex - someone slay the dragin - please (Ronald J Kimball)
    Re: Thread renamed to: where to find perl programming t (Ronald J Kimball)
    Re: variable say $var having value "123" not 123 (David Efflandt)
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Fri, 09 Apr 1999 05:12:55 GMT
From: CARTON LAO <carton.lao@home.com>
Subject: Re: Adding to @INC
Message-Id: <370D8C61.6947F0A8@home.com>

You can create a module that contains a line that says

use lib qw( directory1 directory2 );

Then all your programs need to 'use' this particular module.

 ...Carton Lao

Scott Ranzal wrote:

> Issue:
>
> I would like to add to the directories that have been established for
> searching for Perl libraries.  I am currently doing the additions within the
> scripts, but have several directories that I would like to add on a full
> time basis for every script.
>
> Is there a way to do this ?
>
> Scott Ranzal
> scott.ranzal@mci.com





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

Date: Fri, 9 Apr 1999 01:04:11 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: better way to write this script ?
Message-Id: <1dpypxu.1yw8u1j17ie9xqN@p120.block2.tc2.state.ma.tiac.com>

Mike Mckinney <mike@mike.local.net> wrote:

> sub THROTTLING_RANGE {
>   print "Enter the proportional band : ";
>   chomp( my $pb = <STDIN> );
>   print "Enter the sensor span : ";
>   chomp( my $span = <STDIN> );
>   return( ($pb * $span) / 100 );
> }
> sub PROPORTIONAL_BAND {
>   print "Enter the desired throttling range, in degrees : ";
>   chomp( my $tr = <STDIN> );
>   print "Enter the sensor span : ";
>   chomp( my $span = <STDIN> );
>   return( ($tr / $span) * 100 );
> }

First off, I'd straighten out your prompts and subroutines.

Unless you're trying to confuse your users, of course.  :)

-- 
 _ / '  _      /       - aka -
( /)//)//)(//)/(   Ronald J Kimball      rjk@linguist.dartmouth.edu
    /                                http://www.tiac.net/users/chipmunk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: Fri, 9 Apr 1999 01:04:13 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: Danger!  Near-clueless newbie with a technical question
Message-Id: <1dpyq6s.11axxz816om1dpN@p120.block2.tc2.state.ma.tiac.com>

Sandra Carson <SDC@voicenet.com> wrote:

> So, I want to:
> a) read in a file ('filename.nuc')
> b) strip any extraneous text from the beginning of the file
> c) add the '>' line
> d) remove spaces and line numbers from the sequence
> e) output the results into a second file ('filename.seq')
> 
> Any suggestions/hints/pointers would be highly welcome.

Perl can do all that quite easily.  I would suggest starting with either
Learning Perl or Programming Perl, from O'Reilly and Associates.  The
standard documentation is also quite good.

-- 
 _ / '  _      /       - aka -
( /)//)//)(//)/(   Ronald J Kimball      rjk@linguist.dartmouth.edu
    /                                http://www.tiac.net/users/chipmunk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: Fri, 9 Apr 1999 01:04:14 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: Help with a basic problem!
Message-Id: <1dpyuii.fwnqcg1yxabdqN@p120.block2.tc2.state.ma.tiac.com>

Alex Touche <atouche@netactive.co.za> wrote:

> Hi,
> My name is Alex, I hope that one of the "fundi" can help with a problem. I
> can't find where I made an error, but it won't run. It could be something
> very simple. Any help would be appreciated.
> 
> http://alex-jane.engineering.webjump.com
> 

> begin 666 Mail.pl
> M(R$O=7-R+V)I;B]P97)L#0HD;6%I;'!R;V<@/2 B+W5S<B]L:6(O<V5N9&UA
> M:6PB.PT*)')E8VEP:65N=" ](")U<V5R7&%T;W5C:&5 ;F5T86-T:79E+F-O

> ...

Sorry, that won't run for me either.
Maybe if it were plain text...


-- 
 _ / '  _      /       - aka -
( /)//)//)(//)/(   Ronald J Kimball      rjk@linguist.dartmouth.edu
    /                                http://www.tiac.net/users/chipmunk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: Thu, 8 Apr 1999 22:11:34 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: HELP with Subsitution
Message-Id: <MPG.11772bd2f19573c3989874@nntp.hpl.hp.com>

[Posted and a courtesy copy sent.]

In article <923627714.877037@proxy1.bigplanet.com> on Thu, 8 Apr 1999 
23:14:42 -0400, Dwight Trumbower <dwight@trumbower.com >says...
> Thanks Larry it worked. Care to explain why.  I'm using the Learning Perl
> book and the Perl cookbook and have not seen that syntax.
> 
> Be gentle, we NT guys can a little slow.

I'll try.  :-)

I think Sam Holden's response suffices for an explanation.  He showed 
the same solution I used:

    1 while s/\| +\|/||/;

which you might find more familiar to read if written this way:

    while (s/\| +\|/||/) { }

In words, scan the string from the beginning as many times as necessary 
to match every '| space(s) |' sequence, until there are no more 
matcxhes.

Sam also showed another solution, based on look-ahead, which with a 
minor improvement I consider to be a superior choice:

    s/\| +(?=\|)/|/g;

Here the matching is performed in one scan over the string, each one 
continuing where the previous one left off.

This is cleaner conceptually, IMO, and is significantly faster on your 
example string.

#!/usr/local/bin/perl -w
use Benchmark;

my $s = '|         |         | sdffdff|     |';

timethese(1 << (shift || 0), {
  CX => sub { local $_ = $s; },
  LR => sub { local $_ = $s; 1 while s/\| +\|/||/ },
  SH => sub { local $_ = $s; s/\| +(?=\|)/|/g },
});
__END__

Benchmark: timing 65536 iterations of CX, LR, SH...
        CX:  1 wallclock secs ( 0.83 usr +  0.00 sys =  0.83 CPU)
        LR:  5 wallclock secs ( 3.95 usr +  0.00 sys =  3.95 CPU)
        SH:  3 wallclock secs ( 3.18 usr +  0.00 sys =  3.18 CPU)

-- 
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: 9 Apr 1999 05:34:34 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: HELP with Subsitution
Message-Id: <slrn7gr4b9.376.sholden@pgrad.cs.usyd.edu.au>

On Thu, 8 Apr 1999 22:11:34 -0700, Larry Rosler <lr@hpl.hp.com> wrote:
>
>Sam also showed another solution, based on look-ahead, which with a 
>minor improvement I consider to be a superior choice:
>
>    s/\| +(?=\|)/|/g;

Damn, I should have changed that star to a plus...

Yet again I provide evidence that I almost always seem to write my posts
backwards... I wrote the lookahead one first by simply adding the
lookahead bit to the original, since that was the first solution that jumped
into my brain.

Then I thought, that there was another obvious[1] solution without lookahead...
So I removed the /g and added the while - and created an infinite loop. Then
I changed the * to a + (I should have gone back and changed the first solution
too - oh well). I like showing that TMTOWTDI when possible - one day I'll stop
with the first solution I think of and then I might actually get to answer
before Mr Rolser...

1. I hope that doesn't sound like I'm insulting the original poster. The fact 
that the original didn't work because the '|' is both a starting and ending
character and thus gets 'gobbled up' by the first match is only obvious if
you realise that that is how regular expressions work. It is not obvious if
you aren't very familiar with regular expressions (and how they work).

-- 
Sam

I took the initiative in creating the Internet. 
	--Al Gore


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

Date: 9 Apr 1999 04:23:08 GMT
From: efflandt@xnet.com (David Efflandt)
Subject: Re: Help! Missing first line.....
Message-Id: <slrn7gr02n.jf.efflandt@efflandt.xnet.com>

On Fri, 09 Apr 1999 00:37:09 GMT, wingo01@my-dejanews.com
<wingo01@my-dejanews.com> wrote:
>I'm hoping someone could help me out. I'm just getting into perl and wrote
>the following code. It seems to work fine except that it looses the very
>first line of the input file. Any help would be greatly appreciated.
>
>Thanks.

Quite simple, you read the first line of the file with the 'while'
statement and don't do anything with it.  Then you read the rest of the
file into @upd with the next statement.  You don't even need the 'while',
since in list context, @upd=<UPDF>; reads the entire file all at once.
Try:

open(UPDF,"$workfile"); @upd=<UPDF>; close UPDF;


>open(UPDF,"$workfile"); while (<UPDF>)	{  @upd=<UPDF>;  } close (UPDF);
>foreach $lines (@upd) {  @wline = split(' ',$lines);  $pg = pop(@wline); 
>($ls1,$ls2,$ls3,$ls4,$ls5,$ls6,$ls7,$ls8,$ls9,$ls10)=split(' ',$lines); 
>print "Field #1 is $ls1 and last field is $pg\n";  }

-- 
David Efflandt    efflandt@xnet.com
http://www.xnet.com/~efflandt/


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

Date: Fri, 9 Apr 1999 01:04:16 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: HELP!!  ON  STRING COMPARING
Message-Id: <1dpyvws.11jgtfepbp20sN@p120.block2.tc2.state.ma.tiac.com>

Jay Glascoe <jglascoe@giss.nasa.gov> wrote:

> lufan@hotmail.com wrote:
> > 
> > sub skip_this_link{
> > 
> >     my($linkname)=@_;
> >     $ii = scalar (@filter_a);
> >     foreach($i=0; $i<$ii ;$i++){
> >           $filter_name = @filter_a[$i];
> 
> I think you mean "$filter_a[$i]".  You've written it
> as an array "slice".  In scalar context, the length of
> your slice, namely 1, is returned.

He meant $filter_a[$i], but your assertion about the context is
incorrect.  An array slice in scalar context acts just like a "list" of
comma-separated expressions; it returns the value of the last element.


  DB<1> @foo = qw(first second third)

  DB<2> x $foo = @foo[1]
0  'second'
  DB<3> x $foo = @foo[2,0]
0  'first'
  DB<4> 

-- 
chipmunk (Ronald J Kimball) <rjk@linguist.dartmouth.edu>
perl -e 'print map chop, sort split shift, reverse shift
' 'j_' 'e._jP;_jr/_je=_jk{_jn*_j &_j :_j @_jr}_ja)_js$_j
~_jh]_jt,_jo+_jJ"_jr>_ju#_jt%_jl?_ja^_jc`_jh-_je|' -rjk-


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

Date: Fri, 9 Apr 1999 15:56:38 +1000
From: Patrick Fong <patfong@yoyo.cc.monash.edu.au>
Subject: Hotmail's Homepages
Message-Id: <Pine.OSF.4.00.9904091549190.22876-100000@yoyo.cc.monash.edu.au>

Hi

I know the answer to this question may violate copyright laws, but perhaps
someone could give me a hint about the answer.

If anyone has been to Hotmail.com, and tried to view the source to their
homepages, you will not be able to. How does someone protect other people
from viewing the source to their homepages? (I have seen this question in
a FAQ at irt.org and the answer is you cant).Perhaps someone would know? I
am very interested in it because of the security issues involved in it. 

Oh btw, where can I find out about protecting pages from being viewed? As
in password protect a page? I know of JavaScript capabilities and to some
extent Perl. I have looked in developer.netscape.com and found nothing and
also Perl.com. Perhaps someone who is doing WWW stuff professionally may
be able to point me in the right direction.

Tnx in advance

P.


*************************************************************************************
So how?


*************************************************************************************



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

Date: 09 Apr 1999 00:07:54 -0400
From: Uri Guttman <uri@home.sysarch.com>
Subject: Re: How do I turn this 1000000 into this 1,000,000 in Perl?
Message-Id: <x7pv5esag5.fsf@home.sysarch.com>

>>>>> "SR" == Scott Renton <srenton@ix.netcom.com> writes:

  SR> ##################################
  SR> $x=1000000;
  SR> $x =~ s/000/,000/g;
  SR> print $x;
  SR> ##################################
  SR> enjoy!

it is hard to enjoy a wrong answer. this will work for numbers with only
multiples of 3 digits. try your solution on 10000.

for the correct answer, see perlfaq5,  How can I output my numbers with
commas added?


uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consulting
Have Perl, Will Travel  -----------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com


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

Date: Fri, 09 Apr 1999 04:40:59 GMT
From: andy@-nospam-haveland.com (Andrew Haveland-Robinson)
Subject: Latest AdminMisc and ActiveState's perl
Message-Id: <371871f1.94134000@news.demon.co.uk>

I'm trying to get the latest version of AdminMisc to work with ActiveState's
Perl 514.

I've installed N versions of perl and adminmisc, and found that the CORE
version and Dave's latest adminmisc does what I want, but then I can't use
some other modules that I need.
The adminmisc supplied with the AS514 and PPM AdminMisc package are
hopelessly out of date. (I need Win32::AdminMisc::GetUsers and
Win32::NetAdmin::LocalGroupAddUsers which aren't in the bundled adminmisc)

I've downloaded Dave Roth's latest version that claims to be for AS 511, but
it contains files that bear no apparent relation to what ActivePerl has in
its directories. What AS version are these for then?

>From the readme:

    - IF you are using the ActiveState version of Win32 Perl:
        a) Copy the ADMINMISC.PM file into the directory perl\lib\win32\
        b) Rename the file ADMINMISC_XXX.PLL to ADMINMISC.PLL
        c) Make a directory: perl\lib\auto\win32\adminmisc\
        d) Copy the ADMINMISC.PLL file into the directory in step c

What are pll files? ActiveState uses dll files!

What's the point of AdminMisc_Build_311.zip if it won't work with AS311?

I had more luck with AdminMisc_Build_5_005.zip, which surprisingly works
with AS514, but you'd never guess from the filename! It wants the files in a
different place to where the older bundled modules are already.
Now AS justs needs to get CGI.pm v2.50 included in the next release.

I think there's still some consolidation and synchronisation required here.

Andy.


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

Date: Fri, 9 Apr 1999 01:04:17 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: minimal pattern matching
Message-Id: <1dpywno.qp722e1251he4N@p120.block2.tc2.state.ma.tiac.com>

<sstarre@my-dejanews.com> wrote:

> Yes Sam, and the reason was that I wanted to give you another opportunity to
> complain that someone didn't do a doctoral research project on a question
> before posting it. Honestly, if its SOOOOO difficult to reply without adding
> in complaints, why bother? You we're doing so well up to the end too...

Perhaps you keep getting these complaints because you continue posting
questions that show a lack of sufficient research.  You're also hostile
to the very people that you hope will answer your question.

I remember having a discussion with you about this when you first
started posting to clpm in November.  I guess you're still working on
improving both your research skills and your attitude [*].
*sigh*


[*] Not that this message will help with the latter.  ;)

-- 
 _ / '  _      /       - aka -
( /)//)//)(//)/(   Ronald J Kimball      rjk@linguist.dartmouth.edu
    /                                http://www.tiac.net/users/chipmunk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: Thu, 08 Apr 1999 23:11:04 -0500
From: Tommy Souksamlane <tsouk@intx.net>
Subject: Perl source for ps on NT
Message-Id: <370D7DD7.9D25B9EF@intx.net>

Is there a way to list all processes on NT using Perl?  I would like
something similar in Unix like ps -ef command on NT.

Thanks



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

Date: Fri, 09 Apr 1999 01:47:16 -0400
From: JTJ <elssa09@callisto.si.usherb.ca>
Subject: Re: pragma - The cgi is written in perl
Message-Id: <370D9464.2B54@callisto.si.usherb.ca>

Egads


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

Date: Fri, 09 Apr 1999 01:23:58 -0400
From: JTJ <elssa09@callisto.si.usherb.ca>
Subject: pragma
Message-Id: <370D8EEE.537C@callisto.si.usherb.ca>

I'm using this in a script where I don't want Netscape to cache:

Content-Type: text/html
Pragma: no-cache
Expires: Fri, 01 Jan 1983 00:00:00 GMT

I've also tried this:

Content-Type: text/html
Pragma: no-cache

THE PROBLEM IS ...

I don't want NS to cache, so Netscape creates a temp file in C:\TEMP
Of course I can't click on BACK and FORWARD without a DATA MISSING
warning.

If I use IE, I can still click back and forth through pages and won't
end up with a warning message.

AND it doesn't cache all the same. Both NS and IE use temporary files,
only Netscape destroys its temp files immedaitely, IE will wait until
you exit before it destroys its temp files.

I WOULD LIKE TO

Not cache
and be able to click on BACK and FORWARD in both NS and IE
and teh temp files NS creates are destroyed upon exiting the app, as IE
does.

I've also tried:

Content-Type: text/html
Cache-control: no-cache

Doesn't work.

Does any of this sound familiar?

An e-mail reply would be appreciated.


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

Date: 9 Apr 1999 05:43:50 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: pragma
Message-Id: <slrn7gr4sm.376.sholden@pgrad.cs.usyd.edu.au>

[posted and mailed]

On Fri, 09 Apr 1999 01:23:58 -0400, JTJ <elssa09@callisto.si.usherb.ca> wrote:
>I'm using this in a script where I don't want Netscape to cache:
<snip attempts at getting browsers not to cache...>

And the perl question is...???

You could at least try to work the word 'perl' into the post as a lot of 
people do to try and trick people into thinking it was about perl. A simple
'The cgi is written in perl.' is the most common.

Maybe you should try in a newsgroup that is about WWW/html type of stuff...

-- 
Sam

Just don't create a file called -rf.  :-)
	--Larry Wall


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

Date: Fri, 9 Apr 1999 01:04:19 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: Problem viewing PERL data in browser
Message-Id: <1dpyx7i.l7par21obn41pN@p120.block2.tc2.state.ma.tiac.com>

vinod kudva <vinod.kudva@eds.com> wrote:

> PROBLEM DEFINATION: My PERL program retrieves data at the UNIX prompt,
> but
> does not display at the browser. (My best guess is because the data is
> retrieved slowly from the database)

Another possibility is that the database connection does not succeed
when executing as a CGI script.  Since your script has no error
checking, there's no way of knowing.

-- 
 _ / '  _      /       - aka -
( /)//)//)(//)/(   Ronald J Kimball      rjk@linguist.dartmouth.edu
    /                                http://www.tiac.net/users/chipmunk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: Thu, 08 Apr 1999 21:05:24 -0700
From: Andrew Perrin <aperrin@mcmahon.qal.berkeley.edu>
Subject: Re: Quantum Variable
Message-Id: <370D7C84.DC984C05@mcmahon.qal.berkeley.edu>

Well, I can't answer your actual questions but can suggest some cleaning up that might at least clarify where your error is happening:

Erica Coffin wrote:

>   local($machine,$country) = @_;
>   local($date,$file);

Use my() instead of local() - it's better for most purposes, as it creates its own namespace instead of just localizing the package's namespace.

> #mystery character at the end of $country was clipping
> #any concatenation following $country
>   $country =~ m/(.*\w)/;
>   $country = $1;

You could probably do something like:    $country = $1 if $country =~ /(.*\w)/;
instead, but I doubt if it will help much.

>   $file = "../dir/dir/dir/".$country."_".$machine;

You should either use double quotes or . joins, but not both; either:$file = '../dir/dir/dir/' . $country . '_' . $machine;
 or, preferably (at least to me):
$file = "../dir/dir/dir/$country_$machine";

Hope this helps.
Andy Perrin


>
>
> Testing the value of $file; generates "../dir/dir/dir/United States". (Yes, $machine is being set, and even if it weren't, I should at least be getting "../dir/dir/dir/United States_").
>
> So, no laughing! At least not yet.
>
> : You realize, of course, that I'll be forced to laugh at you if it turns
> : out you're doing
> :   $country . $string;
> : instead of
> :   $country .= $string;



--
-------------------------------------------------------------
Andrew J. Perrin - NT/Unix/Access Consulting -  (650)938-4740
aperrin@mcmahon.qal.berkeley.edu (Remove the Junk Mail King)
     http://www.geocities.com/SiliconValley/Grid/7544/
-------------------------------------------------------------




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

Date: Fri, 9 Apr 1999 01:04:24 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: Quantum Variable
Message-Id: <1dpyxas.khoyss5uhhxeN@p120.block2.tc2.state.ma.tiac.com>

Erica Coffin <ecoffin@allegro.cs.tufts.edu> wrote:

> : Where is your code???
> 
> Right here:
> 
>   local($machine,$country) = @_;
>   local($date,$file);
> #mystery character at the end of $country was clipping
> #any concatenation following $country
>   $country =~ m/(.*\w)/;
>   $country = $1;
>   $file = "../dir/dir/dir/".$country."_".$machine;
> 
> Testing the value of $file; generates "../dir/dir/dir/United States".
> (Yes, $machine is being set, and even if it weren't, I should at least be
> getting "../dir/dir/dir/United States_").
> 
> So, no laughing! At least not yet.

Okay.  But where do you _use_ $file?  You still haven't shown the code
that suggests the concatenation is messing up.

Also, where is $country getting its value?  i.e. where do the contents
of @_ come from in the above code?

One more thing...  Is the above a direct copy-and-paste from your code?
Another typo that might cause this is if the period after $country were
actually a comma.

-- 
 _ / '  _      /       - aka -
( /)//)//)(//)/(   Ronald J Kimball      rjk@linguist.dartmouth.edu
    /                                http://www.tiac.net/users/chipmunk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: 08 Apr 1999 23:12:08 -0600
From: Daniel Grisinger <dgris@moiraine.dimensional.com>
Subject: Re: random number ( -w )
Message-Id: <m31zhu5qdz.fsf@moiraine.dimensional.com>

sholden@pgrad.cs.usyd.edu.au (Sam Holden) writes:

> Well read your own bloody documentation then. I'm not going to tell you
> the answer to a question that is answered in the documentation you 
> have.

YHBT
HAND

:-)

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


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

Date: Thu, 8 Apr 1999 20:56:43 GMT
From: Tim Butler <tbutler@rational.com>
Subject: Returning "undef" from a subroutine. Appears broken in my latest version.
Message-Id: <ixk7lrmygok.fsf@rational.com>


Hi,

   Should the test below print "defined" or "undefined?" I think the
latter, but my latest perl build prints the former. I just want to
make sure I'm right, and that the "foo_perl" below is broken.

Thanks!

----------
#!/usr/local/bin/perl

sub func {
    return undef;
}

%f = func();

if (defined %f) { 
	print "defined\n"; 
} else {
	print "undefined\n";
}

----------

# ./foo_perl -v

This is perl, version 5.002 with DEBUGGING EMBED

Copyright 1987-1996, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5.0 source kit.

# /usr/local/bin/perl -v

This is perl, version 5.005_02 built for sun4-solaris

Copyright 1987-1998, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5.0 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using `man perl' or `perldoc perl'.  If you have access to the
Internet, point your browser at http://www.perl.com/, the Perl Home Page.



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

Date: 08 Apr 1999 21:54:08 -0600
From: Nathan Torkington <gnat@frii.com>
Subject: Re: SORT BY DATE
Message-Id: <m3g16aa1pb.fsf@gnat.ppp.frii.com>

bababozorg@aol.com (Bababozorg) writes:
> can anyone please tell me how to sort my data by date.
> my date is like this: 3-08-99

Rewrite your dates as YYYYMMDD and you can simply use the sort
function.

Nat


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

Date: Fri, 9 Apr 1999 01:04:26 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: Stat::mode? bitwise operator?
Message-Id: <1dpyxhu.eb1krcgy1m9vN@p120.block2.tc2.state.ma.tiac.com>

Peter Bismuti <bismuti@cs.fsu.edu> wrote:

>  Also, it has been suggested that in the statments:
>  
>     if (mode &  0111) 
>     if (mode & 07777) 
>  
>  the numbers 0111 and 07777 are interpreted as decimal and not octal,
>  is this correct?  These numbers make sense to me in octal but don't
>  as decimal.

Who suggested that?  Literal numbers of the form 0NNNNN are always octal
in Perl.  0xNNNNN is hex.  (Note: that's _literal_ numbers only.)

-- 
#!/usr/bin/sh -- chipmunk (aka Ronald J Kimball)
      perl -e'for(sort keys%main::){print if$$_ eq 01}
            ' -s  -- -' Just' -' another ' -'Perl ' -'hacker 
' http://www.tiac.net/users/chipmunk/ [rjk@linguist.dartmouth.edu]


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

Date: Fri, 9 Apr 1999 01:04:28 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: stumped on regex - someone slay the dragin - please.
Message-Id: <1dpyxux.6jxbvr1j54961N@p120.block2.tc2.state.ma.tiac.com>

Eric Smythe <ericsm@iafrica.com> wrote:

> Let us look more closely at those rules.
> 

According to your rules, the weight is also a price.  How should that be
dealt with?

> ---AVOCADOS: 4 kg cntrs IS Hass 18s 7.14  Reed 12s 7.41-8.51
               ^


-- 
 _ / '  _      /       - aka -
( /)//)//)(//)/(   Ronald J Kimball      rjk@linguist.dartmouth.edu
    /                                http://www.tiac.net/users/chipmunk/
perl -e '$_="\012534`!./4(%2`\cp%2,`(!#+%2j";s/./"\"\\c$&\""/gees;print'


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

Date: Fri, 9 Apr 1999 01:04:10 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: Thread renamed to: where to find perl programming tools
Message-Id: <1dpyptk.1x51jmf1btsxsN@p120.block2.tc2.state.ma.tiac.com>

David Cassell <cassell@mail.cor.epa.gov> wrote:

> > <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.
> 
> BTW, great quote.  I wonder if anyone else reading this will know
> the attribution.  "Not the meat ray!"

Townsville is under attack!

-- 
 _ / '  _      /       - aka -
( /)//)//)(//)/(   Ronald J Kimball      rjk@linguist.dartmouth.edu
    /                                http://www.tiac.net/users/chipmunk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: 9 Apr 1999 05:13:10 GMT
From: efflandt@xnet.com (David Efflandt)
Subject: Re: variable say $var having value "123" not 123
Message-Id: <slrn7gr30i.jf.efflandt@efflandt.xnet.com>

On Fri, 02 Apr 1999 13:40:31 GMT, Bob Trieger <sowmaster@juicepigs.com> wrote:
>mpb@kemmunet.net.mt wrote:
>@>Hello All
>@>
>@>If this is faq, forgive me but i'm not a perl wizard
>@>
>@>suppose you have a variable $var="12345"
>@>this will make the value of $var be 12345 
>@>so far so good now for the sticky bit.
>@>
>@>what if you want to make the value of $var be "12345" not 12345 ?
>@>so you can write "12345" to your file not 12345 ?
>
>there are atleast 4 ways to do this:
>
>$var = '"12345"';
>$var = "\"12345\"";
>$var = q("12345");
>$var = qq("12345");

And since the number itself is a variable from the form, the last case is
probably simplest to use, ie:  print FILE qq("$var"); or using the 'here
doc' method to print to the file:

print FILE <<EOF;
A bunch of stuff including "$var".
EOF

>Check out the quote operators in perlop.
>
>
>Good luck,
>
>Bob Trieger
>sowmaster@juicepigs.com       

-- 
David Efflandt    efflandt@xnet.com
http://www.xnet.com/~efflandt/


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

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 5336
**************************************

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