[11125] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4725 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jan 22 20:06:37 1999

Date: Fri, 22 Jan 99 17:00:21 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Fri, 22 Jan 1999     Volume: 8 Number: 4725

Today's topics:
    Re: ancestry of perl features (Abigail)
    Re: Converting String to Integer... (Abigail)
    Re: deleting hash entries (Abigail)
    Re: Finding keys in $HASH{}{} (Charles DeRykus)
        Functions to compare a user's NT password bswann@ptct.com
    Re: How long would the Unixes last without Perl? (Abigail)
    Re: Is there a way to create self contained perl execut gjoshi@my-dejanews.com
    Re: job hit counts, a mini unscientific survey ankadakia@hotmail.com
    Re: job hit counts, a mini unscientific survey (Steve Leibel)
        jpl for windows mattinfo@my-dejanews.com
    Re: Matching Numbers from a string. (Ronald J Kimball)
    Re: Modifying arrays (Abigail)
    Re: Multidimensional arrays. <tbriles@austin.ibm.com>
        Need script for .htpasswd file <js149@hotmail.com>
        Perl For Dummys (BloodStone)
    Re: Perl For Dummys (THE Groovy)
    Re: Perl problem :(Offline mode... (Ronald J Kimball)
    Re: perl script error (Ronald J Kimball)
    Re: Perl5.00502 and @INC (Ronald J Kimball)
    Re: Regular Expression Question ptimmins@netserv.unmc.edu
    Re: Replacing Carriage Returns with commas?? (Alastair)
    Re: string to integer conversion (Abigail)
    Re: string to integer conversion (Abigail)
        Tcl/2K : The 7th USENIX Tcl/Tk Conference Call for Pape (Jennifer Radtke)
    Re: Trying to match a variable with another variable. (Abigail)
    Re: What am I doing wrong with this checksum? <aqumsieh@matrox.com>
    Re: Writing files (Alastair)
    Re: writing to files (Abigail)
    Re: Y2K? <aqumsieh@matrox.com>
    Re: Y2K? (Abigail)
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: 23 Jan 1999 00:25:03 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: ancestry of perl features
Message-Id: <78b4sv$pkn$4@client2.news.psi.net>

David Formosa (aka ? the Platypus) (dformosa@zeta.org.au) wrote on MCMLXX
September MCMXCIII in <URL:news:slrn7ahuah.pa1.dformosa@godzilla.zeta.org.au>:
__ In article <36a8b024@csnews>, Tom Christiansen wrote:
__ 
__ >    OO set-up (hashes, classes)         python
__ 
__ I thourt that perl predates python.

Perl did, but perl5 didn't.



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


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

Date: 22 Jan 1999 20:53:47 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Converting String to Integer...
Message-Id: <78aogr$k4f$1@client2.news.psi.net>

Marvin Lim (marvs@portalinc.com) wrote on MCMLXX September MCMXCIII in
<URL:news:36A7F1C0.C1FF4C53@portalinc.com>:
;;   Hi.. I just wanna know.. How will i convert a string character "45" to
;; an integer 45 ??


Please do learn Perl before using it.



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


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

Date: 22 Jan 1999 21:00:51 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: deleting hash entries
Message-Id: <78aou3$k4f$2@client2.news.psi.net>

Lori Flynn (lori@cse.ucsc.edu) wrote on MCMLXX September MCMXCIII in
<URL:news:788iu0$2nj@darkstar.ucsc.edu>:
[] 
[] print("End of subroutine call value $wayTopHash->{hash}{6}->{valueOne} should be null \n");


This will create '$wayTopHash->{hash}{6}' as a hashref (autovification).
It has been suggested perl shouldn't autovificate in this case, but that
hasn't happened yet AFAIK.



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


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

Date: Fri, 22 Jan 1999 22:40:52 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: Finding keys in $HASH{}{}
Message-Id: <F5zGC4.5JK@news.boeing.com>

In article <XC0q2.10001$7l6.307132@tor-nn1.netcom.ca>,
Mark Priatel <mpriatel@activesystems.ca> wrote:
>I'm building a script which performs a batch process to find out how many
>times a style appears in a document.  To keep all the data in one place, I'm
>sticking the data in a structure like this:
>
>$statistics{$filename}{$style}
>
>To find all the filenames present, I'd do a:
>@files = keys %statistics;
>
>But how would I find all the keys present in the {$style}
>structure...array...field...(whatever you call it...)?!
>
 
Ah, what's in a name... ? But what's buried there is
the rub.

As you've framed your question, I wondered if, perhaps, 
there's another hash or maybe just an array under 
$statistics{$filename}{$style}.  

But, I think you probably mean:

 print keys %{$statistics{$filename}},"\n"; 


For a comprehensive understanding of Perl data structures: 

     perldoc perldsc 


hth,
--
Charles DeRykus


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

Date: Fri, 22 Jan 1999 23:45:50 GMT
From: bswann@ptct.com
Subject: Functions to compare a user's NT password
Message-Id: <78b2jd$pnf$1@nnrp1.dejanews.com>

If I have a simple HTML form that asks for a username and password, I want to
create a CGI script that compares the plaintext password submitted to the
password that is in the NT Domain account for the given user name.

I know how to parse the form, verify that the given username is a valid NT
User account.  I do not know how to check if the password submitted in the
form is the same as the password in the NT account.  I have read through and
try to use the Win32::NetAdmin module, but I don't think it has what I need. 
I also cannot find any examples, FAQs, etc... on trying to do something like
this.


I am trying create a login system for a website that bypasses server/browser
basic authentication.  I want to set the REMOTE_USER http variable so they can
access sevured directories, but not until I have verified there password.


If anyone can point me in the right direction I would be greatly appreciative.
I have been out of PERL for a while and things are kind of rusty in my head.

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: 23 Jan 1999 00:10:07 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: How long would the Unixes last without Perl?
Message-Id: <78b40v$pkn$2@client2.news.psi.net>

Kent Perrier (kperrier@blkbox.com) wrote on MCMLXX September MCMXCIII in
<URL:news:ysivhhzi4su.fsf@blkbox.com>:
"" 
"" 
"" I don't think that there is a commercial UNIX on the market today that
"" ships and installes perl by default.


Doesn't HP ship perl4 by default? And doesn't RedHat come with some
form of Perl?



Abigail
-- 
perl -wleprint -eqq-@{[ -eqw+ -eJust -eanother -ePerl -eHacker -e+]}-


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

Date: Fri, 22 Jan 1999 22:59:51 GMT
From: gjoshi@my-dejanews.com
Subject: Re: Is there a way to create self contained perl executable?
Message-Id: <78avt2$n5p$1@nnrp1.dejanews.com>



Tom,

Got to disagree with you here. If you are working in a customer oriented
job it makes sense. When you send out some code to customers its good
to give them a binary. This way they do not muck around with your code
and change it beyond the point where you can fix it.
I can see your point of view. But with memory growing cheaper by the day,
2M is not much of a penalty anymore.

Girish.


In article <36a5e315@csnews>,
  tchrist@mox.perl.com (Tom Christiansen) wrote:
>  [courtesy cc of this posting sent to cited author via email]
>
> In comp.lang.perl.misc, neilpaku@paradise.net.nz writes:
> :	I couldn't find in the faqs a solution to my problem. I would like to
> :create a script that also contained the perl interpreter so that I could
> :place this script on any machine and run it without having to install
> :perl. Is this possible? The intended platform is nt. If it is possible,
>
> Let's suppose that your script is 5k and the perl installation is
> two megatabytes.  If you give them both together, it costs 2.005
> megabyte.s  If you give them three such scripts,  it's now going to
> cost 6.015 megabytes.  Do you see where this is going?  It's a bad idea.
> Just give them the script.  If they want Perl, they know where to find it.
> If they don't know where to find it, then their professional systems
> admistrator will.  If they don't have one of those, then shame on them --
> computers are not toasters.  But you could install Perl for them if and
> only if Perl is not already installed.   But this "bundle the interpreter
> with the script" on disk every time is just plain dumb.  Just say no.
>
> You don't give a Macintosh application to someone without a Mac.
> You don't give a Windows application to someone without Windows.
> You don't give an X11 application to someone without X11.  There just
> is no good solution for giving perl things to people without perl --
> other than giving them perl!  This is so obvious that perhaps you've
> missed it when it is staring you right there in the face.
>
> --tom
>
> PS:  The cited perl2exe thingie ranges from remarkably stupid at its
>      best to a dangerous lie at its worst, depending on how it is
>      presented.  Forget it.
> --
> pos += screamnext[pos]  /* does this goof up anywhere? */
>     --Larry Wall, from util.c in the v5.0 perl distribution
>

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Fri, 22 Jan 1999 23:16:05 GMT
From: ankadakia@hotmail.com
Subject: Re: job hit counts, a mini unscientific survey
Message-Id: <78b0re$o6n$1@nnrp1.dejanews.com>

Hi About Java
In article <m1zp7bjejj.fsf@halfdome.holdit.com>,
  merlyn@stonehenge.com (Randal L. Schwartz) wrote:
>
> Using Dejanews, I counted the number of times each of the following
> words appeared in "misc.jobs.offered" from 1 Oct 98 to today (about 15
> weeks):
>
>     Perl     140K <<<<<< ding ding ding
>     Excel    120K

=======================
Beautify Your Existance
=======================

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Fri, 22 Jan 1999 15:44:42 -0800
From: stevel@coastside.net (Steve Leibel)
Subject: Re: job hit counts, a mini unscientific survey
Message-Id: <stevel-2201991544420001@192.168.100.2>

In article <m1zp7bjejj.fsf@halfdome.holdit.com>, merlyn@stonehenge.com
(Randal L. Schwartz) wrote:

> Using Dejanews, I counted the number of times each of the following
> words appeared in "misc.jobs.offered" from 1 Oct 98 to today (about 15
> weeks):
> 
>     Unix     870K (queried as "unix | linux")


Randall,

Might get even higher numbers by querying Solaris, HP/UX, BSD, and other
common variants.

Steve L
stevel@coastside.net


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

Date: Sat, 23 Jan 1999 00:24:18 GMT
From: mattinfo@my-dejanews.com
Subject: jpl for windows
Message-Id: <78b4r9$rdt$1@nnrp1.dejanews.com>

Looking at the www.perl.com site at JPL (utility that links Java and Perl
together), I found a version for Unix. I was wondering JPL exists for windows
and download sites. If anyone has any information, please send me email. My
email address is mcg@appsig.com.

Thanks for your time.


Matthew Greenberg

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Fri, 22 Jan 1999 18:52:30 -0500
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: Matching Numbers from a string.
Message-Id: <1dm0c4l.ir62982ul77iN@bay3-116.quincy.ziplink.net>

Ramanujam Parthasarathi <partha@mihy.mot.com> wrote:

> You can match a number by using '\d'.

That's true, but...

> Darko Tunukovic wrote:
> 
> > I have a little problem with matching number from a string.
> >        Like this:      $pattern = "Test Number: 1";
> > How can I get only the number from this string ?
> 
> $pattern =~ /(\d*)/;
> $numbers = $1;

 ...this regular expression will not work.  \d* matches the null string
at the beginning of "Test Number: 1".

Additionally, you should make sure the match succeeded before you use
the value of $1.  If the match failed, $1 will still have its value from
the last successful match.

if (/(\d+)/) {
  $numbers = $1;
}

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


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

Date: 23 Jan 1999 00:12:35 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Modifying arrays
Message-Id: <78b45j$pkn$3@client2.news.psi.net>

Kim Long (kiml@worldnetla.net) wrote on MCMLXX September MCMXCIII in
<URL:news:36a8c060.0@209.4.101.246>:
() Is there a way to remove a value from an array, such that


shift, pop, splice, grep



Abigail
-- 
perl -we '$_ = q ;4a75737420616e6f74686572205065726c204861636b65720as;;
          for (s;s;s;s;s;s;s;s;s;s;s;s)
              {s;(..)s?;qq qprint chr 0x$1 and \161 ssq;excess;}'


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

Date: Fri, 22 Jan 1999 16:54:53 -0600
From: Tom Briles <tbriles@austin.ibm.com>
Subject: Re: Multidimensional arrays.
Message-Id: <36A901BD.D31FE95A@austin.ibm.com>

jambutter@my-dejanews.com wrote:

> I've got the following code
>
> ---------------------------------------------------------
> #!/usr/local/bin/perl  -w
>
> while(<DATA>)
> {
>         push @arrayoflines, [ split(/,/) ];
> }
>
> for $j (0 .. $#arrayoflines)
> {
>         $aref = $arrayoflines[$i];
>         $n = @$aref - 1;
>
>         for $p (0 .. $n)
>         {
>                 print "element $j $p is $aref->[$p]\n";
>         }
> }
>
> __DATA__
> column11,11,column12,12,column13,13
> column21,1,column22,22,column23,23
> ---------------------------------------------------------

The first line of output when this is run will be:

"Name "main::i" used only once: possible typo at ./test.pl line 10."

It should be $j.

That's why the gurus emphasize using "-w", which you wisely have done...just
don't ignore what it's telling you.  :-)

> THANKS.

YOU'RE WELCOME.

- Tom




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

Date: Fri, 22 Jan 1999 18:53:35 -0500
From: JS <js149@hotmail.com>
Subject: Need script for .htpasswd file
Message-Id: <36A90F7F.AC502F23@hotmail.com>

I manage a small web site for a membership organization and we want to
create a members-only area. We want to control access using member names
as user IDs and membership numbers as passwords. Easy so far.

I have no problem using the .htaccess/.htpasswd mechanism because I've
done it before. Since we have 400+ members, what I don't want to do is
to sit and manually input each ID and password for encryption. Does
anyone have a script or utility that will input a text file containing
all 400+ ID/password combos (one per line) and output a file containing
the 400+ encrypted passwords (preferably in the .htpasswd format). 

As a "retired" programmer, I can generally understand the cgi scripts I
use but I'm no perl programmer so I really need something ready-to-go.

Thanks,

Jane Stevens
js148@hotmail.com


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

Date: Fri, 22 Jan 1999 23:09:35 GMT
From: aaron.smith@home.com (BloodStone)
Subject: Perl For Dummys
Message-Id: <36a9050a.3612623@news>

I am starting to learn Perl I was wondering what is the best book to
buy for newbies. I would like a very simple explanation because I want
to make sure that I understand the basics before I get into heavy
stuff. TIA!

P.s. Also if you know any really good sites that fit the above please
send them along too..thanks...

BloodStone


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

Date: 23 Jan 1999 00:11:34 GMT
From: thegroovy@aol.com (THE Groovy)
Subject: Re: Perl For Dummys
Message-Id: <19990122191134.15688.00001109@ng20.aol.com>

Learning Perl, 2nd Edition is the best book (in my opinion) for learning the
basics of Perl. 

Get it here, or at the O'Reilly Website (www.ora.com):
http://www.amazon.com/exec/obidos/ASIN/1565922840/o/qid=917050223/sr=2-2/0
02-6667796-2836606

Regards,
Gil Hildebrand, Jr.
UIN: 28517138
THEGroovy\@aol.com
remove the \ to email me (I hate spam!)


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

Date: Fri, 22 Jan 1999 18:52:32 -0500
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: Perl problem :(Offline mode...
Message-Id: <1dm0coc.rvp0jx189rs0vN@bay3-116.quincy.ziplink.net>

Andrew Fry <andrewf@beausys.demon.co.uk> wrote:

> I was talking about how it is important for me, as company director,
> to use my time wisely ... and how I have only a limited amount of
> time to plough through Perl on-line docs.

So you expected to use our time instead, because as company director
your time is more important than ours?  Maybe that's wise...  It's
certainly not very polite.

Right now it's CGI.pm.  Will you have time to read the documentation for
the next module you want to use, or will you be back with more basic
questions that you expect us to answer?

Of course, if we answer your questions, we'll be expected to answer the
trivial questions of everyone who 'doesn't have time to read the
documentation'.  No thanks.

> What is interesting to one person (eg a newbie) isnt necessarily
> interesting to another (eg an expert). Who are you (or I) to dictate
> what constitutes "interesting" ?

Basic Usenet netiquette: questions that are answered in the FAQ are not
interesting; questions that are answered in the documentation are not
interesting; questions that are answered in the newsgroup archives are
not interesting.

> >   Because we don't want you driving away the knowledgeable folks,
> >   we may need them someday?
> 
> Why would I need somebody whose only response was "Go away and
> read the manuals!" ?

Because maybe someday you'll actually have an interesting question that
you need answered by a knowledgable person.  Sure, it seems like a
stretch, but you never know.

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


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

Date: Fri, 22 Jan 1999 18:52:33 -0500
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: perl script error
Message-Id: <1dm0daj.oppiie174s9xaN@bay3-116.quincy.ziplink.net>

<kamez@my-dejanews.com> wrote:

> open(IN,"<$name" ) or die "can't open file: $!\n";
> 
> this previous line , causes this error message :
> 
> "bash: syntax error near unexpected token `open(IN,"<$name"'  "
   ^^^^

As you can see, this is an error message from bash, not from Perl.  You
probably forgot to start your script with:

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

as the very first line.  Make sure you specify the actual path to Perl
on your system.  (You should be able to find it with `which perl`.)

Refer to the perlrun documentation for more info.

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


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

Date: Fri, 22 Jan 1999 18:52:34 -0500
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: Perl5.00502 and @INC
Message-Id: <1dm0dhc.q49n001vo35t3N@bay3-116.quincy.ziplink.net>

Kevin Clancy PhD <clancy@eri.uchsc.edu> wrote:

> When I now call the prog under the latest perl, I get a message that
> program-paths.pl cannot be found in @INC (it lists all the direcories it
> can see but doesn't include the program-paths.pl directory. Do I now
> need to push @INC the directories?

Presumably, when the latest version of Perl was installed, this missing
path was left out.


Instead of pushing onto @INC, there is a new and improved way:

use lib '/path/to/dir';

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


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

Date: Sat, 23 Jan 1999 00:35:45 GMT
From: ptimmins@netserv.unmc.edu
Subject: Re: Regular Expression Question
Message-Id: <78b5h1$s7a$1@nnrp1.dejanews.com>

In article <MPG.1112465d6588e5309899b9@nntp.hpl.hp.com>,
  lr@hpl.hp.com (Larry Rosler) wrote:

> 'something' would include something as popular as vi!  It is maddening
> to do a substitution with capture (which looks just like Perl:
> s/.../.../g) and have to remember to backslash the parentheses in the
> regex and to use '\1' etc. in the substitution instead of '$1'.

A while back, I started banging my forehead on the ESC key whenever I needed
to go into command mode. This reminds me that I need to be aware of the
differences in regex syntax.

For awhile, I tried only using my tongue to press the '/' key when in
command mode as a reminder ... but this turned out to be a bit of a
kludge, so I stopped :p

Patrick Timmins
$monger{Omaha}[0]

(ouch!)
:wq

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Fri, 22 Jan 1999 23:33:54 GMT
From: alastair@calliope.demon.co.uk (Alastair)
Subject: Re: Replacing Carriage Returns with commas??
Message-Id: <slrn7ai2og.61.alastair@calliope.demon.co.uk>

Tom Renic <trenic@nortelnetworks.ca> wrote:
>I'm new to the field of cgi and perl so please forgive my naiveness. How
>can parse a
>carriage return and replace it with a comma? I need to setup a text file
>that can inserted into an Excel worksheet so all of the information
>gathered from the form (including the textareas) must be put into the
>.txt file on a single line. Can some PLEASE help???

Do this the same way you'd replace _any_ character with another. Look out for
the 'tr' operator (see perlop). You have a lot of docs on disk ;

perldoc perlop

e.g.

#!/usr/bin/perl -w

while (<DATA>) {
	tr/\n/,/;
	print;
}

__DATA__
hello
out
there


I assume your 'carriage returns' are unix like here '\n'.

HTH.

-- 

Alastair
work  : alastair@psoft.co.uk
home  : alastair@calliope.demon.co.uk


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

Date: 22 Jan 1999 21:03:55 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: string to integer conversion
Message-Id: <78ap3r$k4f$4@client2.news.psi.net>

Lee Benfield (lbenfie1@nospamford.com) wrote on MCMLXX September MCMXCIII
in <URL:news:36A86041.8DBD8354@nospamford.com>:
!! Err, james, I'm sure this is bound to be in 
!! 
!! a) the FAQ
!! b) (definitely) the Manual.
!! 
!! use 
!! 
!! int($mystring)


No. That's silly.



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


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

Date: 22 Jan 1999 21:03:23 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: string to integer conversion
Message-Id: <78ap2r$k4f$3@client2.news.psi.net>

James (mayo98@portalinc.com) wrote on MCMLXX September MCMXCIII in
<URL:news:789mvj$8ff$1@news.ncal.verio.com>:
'' Sirs,
'' 
'' Hi.. I'm new to perl. I would like to know how will i Convert a string
'' number "47" to integer number 47 ??

Please. Learn the most basics of Perl first. Don't invent things that
aren't there.



Abigail
-- 
perl -wlne '}for($.){print' file  # Count the number of lines.


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

Date: Fri, 22 Jan 1999 23:57:01 GMT
From: jennifer@usenix.org (Jennifer Radtke)
Subject: Tcl/2K : The 7th USENIX Tcl/Tk Conference Call for Papers
Message-Id: <F5zJv1.4y6@usenix.org>
Keywords: USENIX, Tcl/TK, Tcl, TK, conference, tutorials, training,  Invited Talks, research, Refereed Papers, Unix, Cross-Platform Development, CGI Scripting, Object Oriented Programing, [incr Tcl], Mega Widgets, Database, Client/Server Applications, extension Building, SWIG, C, Debugging, testing, Packaging, Java, HTTP Tcl Daemon, CGI-BIN, mapping, embedding, applications, commands, Data Objects, Tycho Slate, WinACIF, Iclient/Iserver, Distributed, language, management, Yacc, Corba, Novell, extensions, designing, supporting, developing, portable, opensource GUI, rapid-development, extensible, X11 Windows


Tcl/2K : The 7th USENIX Tcl/Tk Conference
   February 14-18, 2000
   Austin, Texas, USA

Sponsored by USENIX, The Advanced Computing Systems Association

=============================================================
Important Dates
    Paper, Demonstration, and Panel Proposals due: September 1, 1999
	Poster submissions due: December 8, 1999
=============================================================

The 7th USENIX Tcl/Tk Conference is a forum to:
         * bring together Tcl/Tk researchers and practitioners
         * publish and present current work involving Tcl/Tk
         * learn about the latest developments in Tcl/Tk
         * plan for future Tcl/Tk related developments

The conference program will include formal paper and panel
presentations, poster and demonstration sessions, works in progress
(WIP) sessions, Birds of a Feather (BOF) sessions, and tutorials.  All
forms of participation provide an opportunity to report on original
Tcl/Tk research. Formal papers should address topics of interest to
experienced Tcl/Tk programmers; posters and informal demos may be geared
to any level of user from beginner to expert.

Best Paper Awards will be given for the best paper and best student
paper at the conference.
=============================================================
USENIX is the Advanced Computing Systems Association.  Our international
membership includes engineers, system administrators, scientists, and
technicians.  Our conferences are recognized for delivering pragmatic,
technically excellent information in a highly interactive,
vendor-neutral forum.





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

Date: 22 Jan 1999 21:06:55 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Trying to match a variable with another variable.
Message-Id: <78ap9f$k4f$5@client2.news.psi.net>

Matt Johnson (cpuweb@cpuweb.com) wrote on MCMLXX September MCMXCIII in
<URL:news:788fb6$6pq$1@news.ipa.net>:
() This is the code I have so far:
() 
() if ($fields{'sort1'} eq $fieldname1 or $fieldname2  or $fieldname3 or
() $fieldname4 or $more) {
() # Do somehting.
() }
() 
() What I want to do is find out which one of them it matched and be able to
() asign it to a variable, instead of making an if statement for each one. I
() know there is a way to do it but can't seem to find it.


You don't understand or.


if ($fields {sort1} eq $fieldname1  or
    $fields {sort1} eq $fieldname2  or
    $fields {sort1} eq $fieldname3  or
    $fields {sort1} eq $more) {
    # Do something.
}


Abigail
-- 
sub f{sprintf$_[0],$_[1],$_[2]}print f('%c%s',74,f('%c%s',117,f('%c%s',115,f(
'%c%s',116,f('%c%s',32,f('%c%s',97,f('%c%s',0x6e,f('%c%s',111,f('%c%s',116,f(
'%c%s',104,f('%c%s',0x65,f('%c%s',114,f('%c%s',32,f('%c%s',80,f('%c%s',101,f(
'%c%s',114,f('%c%s',0x6c,f('%c%s',32,f('%c%s',0x48,f('%c%s',97,f('%c%s',99,f(
'%c%s',107,f('%c%s',101,f('%c%s',114,f('%c%s',10,)))))))))))))))))))))))))


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

Date: Fri, 22 Jan 1999 13:35:08 -0500
From: Ala Qumsieh <aqumsieh@matrox.com>
To: rrafydoj@hotmail.com
Subject: Re: What am I doing wrong with this checksum?
Message-Id: <x3ybtjrtauc.fsf@tigre.matrox.com>


[posted and mailed]

rrafydoj@hotmail.com writes:

> a = "My Name";
> # Next line returns the ascii sum of the string
> b = unpack("%16C*",a);
> 
> Now, at this point, I need to convert b, which is 615, to binary to arrive at
> "0000001001100111".  Next, I need to convert each 4-bit chunk back into
> decimal (don't ask), to arrive at the number "0267".

BCD?

here you go:

my $a = "My Name";
my $b = unpack("%16C*", $a);
my $c = unpack "B*", pack "N", $b;  # this has your binary number
my $d = "";
while ($c =~ /(\d{4})/g) {
        $d .= unpack "N", pack "B32", substr "0" x 32 . $1, -32;
}

print "D is $d.\n";
__END__


this prints:
D is 00000267.


Hope this helps,
Ala



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

Date: Sat, 23 Jan 1999 00:14:57 GMT
From: alastair@calliope.demon.co.uk (Alastair)
Subject: Re: Writing files
Message-Id: <slrn7ai55g.61.alastair@calliope.demon.co.uk>

R. Alcazar <alcazar@netcomp.net> wrote:
>
>    Hello all,
>
>    I'm trying to do something quite simple...  however, its got me stumped.
>All I wanna do is open a file (thus, creating a new file) inside of a
>directory store in my webserver.  However, it fails and returns an error:
>permission denied.  Such that:
>
>    open(SOMEFILE, "/somedirectory/somefile.txt") || die "$!\n";
>
>    I've checked the file permissions, and the only way I can get it to
>write to that directory is if I specify 777 on that directory.  (Which is
>obviously what I DON'T want to do).  It seems that (at the very least) in
>order for me to open/create a file inside that directory I need permissions
>of 007.  I wrote another script outside of my prog which does the same thing
>and that seems to be working fine.

Do an 'ls -l' on the root (doc root?) directory. 

what are the permissions/ownership?

What is the difference between the working script and the non-working script?

What user does your broken script run as? Is it different to the working script?


-- 

Alastair
work  : alastair@psoft.co.uk
home  : alastair@calliope.demon.co.uk


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

Date: 22 Jan 1999 21:29:08 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: writing to files
Message-Id: <78aqj4$lo2$1@client2.news.psi.net>

J Holden (jholden@voyager.net) wrote on MCMLXIX September MCMXCIII in
<URL:news:7880mp$87d@news.voyager.net>:
** Is there any simple way to insert into the top of a file instead of
** jsut appending to the bottom?


FAQ


Abigail
-- 
perl -wlne '}for($.){print' file  # Count the number of lines.


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

Date: Fri, 22 Jan 1999 13:01:24 -0500
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: Y2K?
Message-Id: <x3yd847tcej.fsf@tigre.matrox.com>


tumppi@icon.fi (Tuomas Angervuori) writes:

>     ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = 
> localtime(time);

[snip]

>         if ($year > $year_data) {
> 
> As you might have noticed, this isn't year 2000 compatible. The 
> question is, how can I make year 2000 compatible date comparisition? 
> I'm sure there is a much better way to do this but this was all I 
> managed to do with my current programming skills.

from perldoc -f localtime:

 ......
All array elements are numeric, and come straight out of a struct tm.
In particular this means that $mon has the range 0..11 and $wday has
the range 0..6 with sunday as day 0.  Also, $year is the number of
years since 1900, that is, $year is 123 in year 2023.
 ......

so .. to get the real year, just add 1900:

if ($year + 1900 > $year_data) {

 ...
}

Of course, this is assuming $year_data is a four-digit number like
1998 or 2010 or whatever.

Hope this helps,
Ala



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

Date: 22 Jan 1999 23:57:07 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Y2K?
Message-Id: <78b38j$pkn$1@client2.news.psi.net>

dhosek@webley.com (dhosek@webley.com) wrote on MCMLXX September MCMXCIII
in <URL:news:78aah9$3mp$1@nnrp1.dejanews.com>:
\\ 
\\ The fact that the localtime function returns a year in 2-digit format
\\ confuses a lot of people who assume that this means that it will return 00
\\ for the year 2000. It will, in fact return 100 for the year 2000. To convert
\\ a year to 4-digit format (which presumably was the source of the original
\\ poster's concern), it is adequate to simply add 1900 to the year. On the

Yes. But if you compare two dates, it doesn't matter whether you add 1900
on both sides or not....

\\ other hand, if you're still using a 32-bit system in the year 2038, Unix date
\\ functions in general will fail (or at least those that use seconds since
\\ 1970).

64-bits aren't the answer for that. I've 64-bit hardware, and a 64-bit
OS, but my time still wraps in 2038. The problem isn't the hardware or
the OS. The year 2038 problem is exactly the same as with Y2K: external
storage and synchronisation.



Abigail
-- 
perl -e 'for (s??4a75737420616e6f74686572205065726c204861636b65720as?;??;??) 
             {s?(..)s\??qq \?print chr 0x$1 and q ss\??excess}'


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

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

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