[11775] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5375 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Apr 13 18:07:25 1999

Date: Tue, 13 Apr 99 15:00:17 -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, 13 Apr 1999     Volume: 8 Number: 5375

Today's topics:
        bioperl-99 <birney@sanger.ac.uk>
    Re: Converting from octal to decimal (Randal L. Schwartz)
    Re: Converting from octal to decimal scraig@my-dejanews.com
    Re: Converting from octal to decimal <cassell@mail.cor.epa.gov>
    Re: Converting from octal to decimal (Abigail)
    Re: Hash symbol '%' a stylized what? (Charles DeRykus)
    Re: Hash symbol '%' a stylized what? <gellyfish@gellyfish.com>
    Re: Help with Perl and Microsoft Exchange <gellyfish@gellyfish.com>
        How to get this into a Win 32 module <greg2@surfaid.org>
    Re: How to write a format to an array instead of a file <uri@home.sysarch.com>
    Re: implement useradd in perl <uri@home.sysarch.com>
        MLDBM (EXCHANGE:SKY:1Z22)
        Need Perl Tutor - Naperville, IL skrana@my-dejanews.com
        Password change with Perl kevin_collins@my-dejanews.com
    Re: Problem with my & local declarations <cassell@mail.cor.epa.gov>
    Re: Problem with my & local declarations <uri@home.sysarch.com>
    Re: String matching (Tad McClellan)
    Re: TPJ still shipping? (Tad McClellan)
    Re: TPJ still shipping? <uri@home.sysarch.com>
        what does this error msg mean? <geotrace@shentel.net>
    Re: Where we can get perl code snippets? (Marc Haber)
    Re: Where we can get perl code snippets? <uri@home.sysarch.com>
    Re: Win32 Mail Client <gellyfish@gellyfish.com>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Tue, 13 Apr 1999 21:24:42 +0100
From: Ewan Birney <birney@sanger.ac.uk>
Subject: bioperl-99
Message-Id: <Pine.OSF.4.10.9904132124140.32181-100000@scarp.sanger.ac.uk>




   The bioperl workshop '99
   ========================

Bioperl is a project for bringing together topics in life science
research which use Perl. The project is coordinated from

  http://bio.perl.org/

The bioperl workshop will be held on thursday 5th August 1999 in DKFZ
in heidelberg, Germany. This is the day before the ISMB conference in
heidelberg. The workshop is aimed at a broad auidence of researchers,
from both biological and computer science backgrounds. The website for
the workshop is at

 http://bio.perl.org/bioperl-99/

The workshop format is of a day of talks and posters. Two keynote
speakers are already booked

   Steve Chervitz - bioperl coordinator
   Lincoln Stein  - Author of CGI.pm and Aceperl

For more information, including registration details, please go to the
web site.


Ewan Birney
<birney@sanger.ac.uk>
http://www.sanger.ac.uk/Users/birney/



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

Date: 13 Apr 1999 13:17:11 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Converting from octal to decimal
Message-Id: <m167705l88.fsf@halfdome.holdit.com>


[note: comp.lang.perl is dead.  Real dead.  Stop using it to post.]

>>>>> "Mike" == Mike Rizzo <mrizzo@ismd.ups.com> writes:

Mike> $oct = $ARGV[0];
Mike> $dec = oct($oct);
Mike> print "octal is $oct , decimal is $dec";
Mike> ******************************************
Mike> The value I am getting in $dec is not correct,
Mike> When i pass it in 16895, I get the value of $dec to be 14, when in
Mike> fact should be 40777 according to the perl line above,
Mike> Any ideas as to why the the oct() function is not converting
Mike> the number properly.

You probably need to start with a valid octal number.  Hint: octal
numbers don't have 8's or 9's in them.

I think you got the oct() function backwards. :)

print "Just another Perl hacker,"

-- 
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, 13 Apr 1999 21:11:16 GMT
From: scraig@my-dejanews.com
Subject: Re: Converting from octal to decimal
Message-Id: <7f0btd$mqd$1@nnrp1.dejanews.com>

In article <7evrhd$sns6@innsrv.ismd.ups.com>,
  "Mike Rizzo" <mrizzo@ismd.ups.com> wrote:
> $oct = $ARGV[0];
> $dec = oct($oct);
> print "octal is $oct , decimal is $dec";

> The value I am getting in $dec is not correct,
> When i pass it in 16895, I get the value of $dec to be 14, when in
> fact should be 40777

    oct() takes a string it assumes is an octal number and returns the decimal
equivalent.

    When a string is interpreted as a number, a legitimate form of the number
must be at the at the beginning of the string, possibly following some
whitespace. Beginning with the first non-legitimate character, the rest of the
string is ignored.

    Eg. "1Mississippi, 2Mississippi" is 1
    Eg. " a 1 anda 2 "               is 0

    Returning to your specific problem, I don't quite agree with your
calculations. 16895 is not an octal number. It has an 8 and a 9 in it. This
makes it difficult to convert to a decimal.

  Perl is interpreting the string "16895" as 16 (octal) which is 14
(decimal).

  It appears that you don't want to use oct() at all. Rather, you want the
reverse conversion: 16895 in decimal to an octal number. For this use printf
or sprintf.

 $dec = $ARGV[0];
 $oct = sprintf "%lo", $dec;
 print "octal is $oct , decimal is $dec";

HTH

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


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

Date: Tue, 13 Apr 1999 14:29:29 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Converting from octal to decimal
Message-Id: <3713B739.B53809A7@mail.cor.epa.gov>

Mike Rizzo wrote:
> 
> Ok, here is the deal, I have a value being returned from stat, from an
> earlier question/answer I found out that the number is being returned as an
> Octal number. The following code,
> perl -e "printf('Mode is %0o',(stat($ARGV[0]))[2])" fn
> prints out the octal number in a more usable and readable decimal
> number, however when I try to run this little perl script,
> ******************************************
> $oct = $ARGV[0];
> $dec = oct($oct);
> print "octal is $oct , decimal is $dec";
> ******************************************
> The value I am getting in $dec is not correct,
> When i pass it in 16895, I get the value of $dec to be 14, when in
> fact should be 40777 according to the perl line above,
> Any ideas as to why the the oct() function is not converting
> the number properly.
> 
> Thanks

Perl is doing its best to DWIM (Do What I Mean) here.  You give
oct() a number in octal, not the other way around.  So Perl sees
16895, takes as many legal digits as possible, and silently drops
the '895'.  oct(16) is 14 (base 10).  Check out oct() in the perlfunc
section [try typing `perldoc -f oct' to get just the oct() entry],
and you'll see.  OTOH, oct(40777) will give you 16895, just as you
expected.

HTH,
David
-- 
David Cassell, OAO                               
cassell@mail.cor.epa.gov
Senior Computing Specialist                          phone: (541)
754-4468
mathematical statistician                              fax: (541)
754-4716


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

Date: 13 Apr 1999 21:48:59 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Converting from octal to decimal
Message-Id: <7f0e4b$rdj$1@client2.news.psi.net>

Mike Rizzo (mrizzo@ismd.ups.com) wrote on MMLI September MCMXCIII in
<URL:news:7evrhd$sns6@innsrv.ismd.ups.com>:
== ******************************************
== $oct = $ARGV[0];
== $dec = oct($oct);
== print "octal is $oct , decimal is $dec";
== ******************************************
== The value I am getting in $dec is not correct,
== When i pass it in 16895, I get the value of $dec to be 14, when in
== fact should be 40777 according to the perl line above,
== Any ideas as to why the the oct() function is not converting
== the number properly.


Decimal 14 is octal 16. And since 8 and 9 aren't octal numbers, 
I'd say 14 is a very good result.



Abigail
-- 
perl5.004 -wMMath::BigInt -e'$^V=Math::BigInt->new(qq]$^F$^W783$[$%9889$^F47]
 .qq]$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W]
 .qq]98$^F76777$=56]);$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V
%$^U;$^V/=$^U}while$^V!=$^W'


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

Date: Tue, 13 Apr 1999 20:34:11 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: Hash symbol '%' a stylized what?
Message-Id: <FA5AGz.zn@news.boeing.com>

In article <3712B458.63DEFDCF@erols.com>,
Matthew O. Persico <mpersico@erols.com> wrote:

> If Sir Larry were Brittish, what animal would have been the Perl Mascot? 
> Certainly not a camel, yes?

No, quite. Think of the spiritual parallels with Laurence of 
Arabia... 


--
Charles DeRykus


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

Date: 13 Apr 1999 20:35:17 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Hash symbol '%' a stylized what?
Message-Id: <7f09q5$hi$1@gellyfish.btinternet.com>

On Mon, 12 Apr 1999 23:04:56 -0400 Matthew O. Persico wrote:
> Jonathan Stowe wrote:
>> 
>> On 12 Apr 1999 07:40:16 -0700, gerg@shell1.ncal.verio.com (Greg
>> Andrews) wrote:
>> 
>> >damian@cs.monash.edu.au (Damian Conway) writes:
>> >>
>> >>         4. Perl Institute known as Department of Perl Affairs.
>> >>
>> >
>> >s/Department/Ministry/  perhaps?
>> >
>> 
>> It depends whether this body will be headed by A Secretary of State
>> for Perl Affairs or a Minister for Perl Affairs of course ...
>> 
>> /J\
> 
> Ok, two questions:
> 
> 1) How do we go about getting Larry to be knighted? Or should we just go around calling him Sir Larry anyway?

OK.  Next time I'm round at Liz and Phil's London place I'll make the
proposition.

> 2) If Sir Larry were Brittish, what animal would have been the Perl Mascot? Certainly not a camel, yes?
> 

I'd go Unicorn myself.  Look nice on some t-shirt too.

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


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

Date: 13 Apr 1999 21:27:11 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Help with Perl and Microsoft Exchange
Message-Id: <7f0crg$ht$1@gellyfish.btinternet.com>

On Sun, 11 Apr 1999 13:32:57 -0700 David Cassell wrote:
> Chris Newman wrote:
>> 
>>                                          I then want to send this
>> report as an attachment to my e-mail account (we run Microsoft Outlook
>> and Exchange Server).
> 
> Check out the Mail::* modules at CPAN.  Mail::Mailer is unix-centric, 
> while Mail::Internet uses Net::SMTP, which should do the trick.  
> I think M$ Exchange Server handles SMTP.
> 

Actually in this environment it might be preferable to use Win32::OLE
to create the mail object and attachments etc in Outlook.  There is an
example in the Win32 specific documentation that comes with ActivePerl.

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


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

Date: Tue, 13 Apr 1999 22:54:32 +0100
From: Greg Griffiths <greg2@surfaid.org>
Subject: How to get this into a Win 32 module
Message-Id: <3713BD18.71C68B00@surfaid.org>

I've just finished a rather large databasae application using ODBC.pm
and have noticed that the majority of my scripts use the same code to
produce the right hand column in the table, and I'd like to turn this
into a module, but I've read the doc's and the FAQ's and the Perl
Programming book adn am no wiser on how to do it, could someone help me
out.

Thanks in advance.

The Code is :

use Win32::ODBC

$DSN= "methsoc";
if (!($db = new Win32::ODBC($DSN))){
              print "Error connecting to $DSN\n";
              print "Error: " . Win32::ODBC::Error() . "\n";
              exit;
          }

# print other cell
print<<"EOQ";
<td width="25%" valign="top"
background="http://www.aber.ac.uk/~scty12/links/graphics/backgrounds/marble2.jpg">
<p><hr><br>
<center>
<a href="/cgi-bin/links/user/newlinks.pl"
onMouseOver="window.status='New Sites added to our collection'; return
true" onMouseOut="window.status=window.defaultStatus"><img
src="http://www.aber.ac.uk/~scty12/links/graphics/animations/new3.gif"
alt="New Links"></a><p><hr><br>
EOQ

$SqlStatement2 = "SELECT tblIndexName.CategoryID, tblIndexName.Name,
tblIndexName.CategoryImage, tblIndexName.DisplayCategoryImage,
tblIndexName.Parent, tblIndexName.Suspended
FROM tblIndexName
WHERE (((tblIndexName.Parent)=0) AND ((tblIndexName.Suspended)=No))";

# add the dynamic content
if ($db->Sql($SqlStatement2)){
              print "SQL failed.\n";
              print "Error: " . $db->Error() . "\n";
              $db->Close();
              exit;
	}

while($db->FetchRow()){
              undef %Data;
              %Data = $db->DataHash();
undef $printstring;

$ID = $Data{'CategoryID'};
$Name = $Data{'Name'};
$Image = $Data{'CategoryImage'};
$DisplayImage = $Data{'DisplayCategoryImage'};

# prepare the Link
$Link="\/cgi-bin\/links\/user\/displaycontents.pl?".$ID;

if ((length $Image)>0)
{
# prepare the URL of the image by removing the # delimiters
$Image = substr($Image,1,-1);
	
$printstring="<a href=\"$Link\" onMouseOver=\"window.status=\'Please
visit the collection of sites we have on $Name\'; return true\"
onMouseOut=\"window.status=window.defaultStatus\"><img src=\"$Image\"
alt=\"$Name\" HEIGHT=\"40\" WIDTH=\"40\"><br>$Name<\/a><p><hr><br>";
}
else
{
$printstring="<a href=\"$Link\" onMouseOver=\"window.status=\'Please
visit the collection of sites we have on $Name\'; return true\"
onMouseOut=\"window.status=window.defaultStatus\">$Name<\/a><p><hr><br>";
}

# and output it
print "$printstring\n" if ($printstring);
}

# add the rest of the cell, and the footer
print<<"EOP";
<a href="http://www.aber.ac.uk/~scty12/links/prayer.html"
onMouseOver="window.status='If you feel in need of prayer'; return true"
onMouseOut="window.status=window.defaultStatus">Submit a Prayer
Request</a><p><hr><br>
<a href="http://www.aber.ac.uk/~scty12/links/rings.html"
onMouseOver="window.status='Webrings and Banner Exchanges that we are
part of'; return true" onMouseOut="window.status=window.defaultStatus">
Christian Web Rings</a><p><hr><br>
<a href="http://www.aber.ac.uk/~scty12/"
onMouseOver="window.status='Aberystwyth Methsoc have a great home page
!!'; return true" onMouseOut="window.status=window.defaultStatus"><img
src="http://www.aber.ac.uk/~scty12/graphics/logos/abermeth2.gif"
height=90 width=100></a><p><hr><br>
<a href="/cgi-bin/links/discpriv.pl" onMouseOver="window.status='Our
site disclaimer & privacy statement'; return true"
onMouseOut="window.status=window.defaultStatus"><b>Disclaimer & Privacy
Statement</a></b><p><hr><br>
<form NAME="login" ACTION="/cgi-bin/links/login.pl" METHOD="post"><input
TYPE="submit" VALUE="LOG IN"></form><p><hr><br>
<font color="red"><b>Feedback & Comments</b><p>
<a href="/cgi-bin/links/forms/add.pl"
onMouseOver="window.status='Recommend a Site to be added to our
Collection'; return true"
onMouseOut="window.status=window.defaultStatus">ADD</a> | <a
href="/cgi-bin/links/forms/update.pl" 
onMouseOver="window.status='Report a broken or unsuitable link etc';
return true" onMouseOut="window.status=window.defaultStatus">UPDATE</a>
| <a href="/cgi-bin/links/forms/general.pl"
onMouseOver="window.status='Other feedback, More information on
Christianity, site comments etc'; return true"
onMouseOut="window.status=window.defaultStatus">GENERAL</a></font><p><hr><br>
<a href="http://www.rsac.org" onMouseOver="window.status='We are rated
with RSAC'; return true"
onMouseOut="window.status=window.defaultStatus"><img
src="http://www.aber.ac.uk/~scty12/links/graphics/logos/rsacirated.gif"></a><p><hr><br>
<a href="http://www.flipside.co.uk/cleanweb/"
onMouseOver="window.status='We are rated with CleanWeb'; return true"
onMouseOut="window.status=window.defaultStatus"><img alt="[CleanWeb
Approved Site]" border=0
src="http://www.aber.ac.uk/~scty12/links/graphics/logos/cwlogo.gif"
width=90 height=110></a><p><hr><br> 
<font color="black"><a href="/cgi-bin/links/index.pl"
onMouseOver="window.status='Back to the Home Page'; return true"
onMouseOut="window.status=window.defaultStatus">HOME</a></font>
<p><hr><br>
</b></center>
</td></tr>
</table>
</body>
</html>
EOP


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

Date: 13 Apr 1999 16:59:00 -0400
From: Uri Guttman <uri@home.sysarch.com>
Subject: Re: How to write a format to an array instead of a filehandle?
Message-Id: <x7yajwnsob.fsf@home.sysarch.com>

>>>>> "DC" == David Cassell <cassell@mail.cor.epa.gov> writes:

  DC> Uri Guttman wrote:
  >> but the format stuff has a func called formline which does exactly what
  >> the poster wants. it formats to $^A. see perlform for more info.

  DC> Neat.  I learn stuff all the time from reading this ng.
 
  DC> Perhaps.  But for most of my needs, sprintf() is more useful and
  DC> more flexible.  YMMV.

and here is the irony of it all:

in 7+ years of perl hacking, i have never once used FORMAT!! and i am
the one who mentioned formline. i wrote to this guy (he stealthed
emailed me which makes me not want to help him much more) about sprintf
too. just for a kicker, i am the author of the padding answer in the
perl FAQ and i don't mention formline there.

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: 13 Apr 1999 16:54:49 -0400
From: Uri Guttman <uri@home.sysarch.com>
Subject: Re: implement useradd in perl
Message-Id: <x73e24p7fq.fsf@home.sysarch.com>

>>>>> "u" == usenet  <chris> writes:

  u> In article <m13e247bt7.fsf@halfdome.holdit.com>,
  u> Randal L. Schwartz <merlyn@stonehenge.com> wrote:
  >> And I never saw the need for a crutch like "useradd", except to
  >> implement local policy (mail aliases here, standard .cshrc there).  So
  >> when people ask for "useradd", I tend to respond "Well, you'll need to
  >> customize it almost entirely, so why are you asking for a stock one?"

  u> So they don't have to reinvent the whole wheel, probably reinventing
  u> the same old mistakes and security holes all over again?

i think you are confused about what randal is saying. there is no easy
way to create a useradd that is portable! so you kind of have to
reinvent the wheel for each platform you admin. maybe a part of the
script could be the same but the work it has to do for each function
would be platform specific. randal is saying basically the same thing,
that asking for a stock one (portable) is a waste since you have to
customize so much. and as i said, so much of the customizing is SITE
specific and not platform specific, that it is almost impossible to
anticipate all possible variations. i have seen too many sites (as a
consultant i see many different sites) and they are all different and
unfortunately only a few seemed to have any version of a local useradd. 

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: Tue, 13 Apr 1999 16:51:54 -0400
From: "Soulier, Michael (EXCHANGE:SKY:1Z22)" <msoulier@americasm01.nt.com>
Subject: MLDBM
Message-Id: <3713AE6A.7BB29721@americasm01.nt.com>

Has anyone here had any problems building and using the MLDBM module on
HP/UX? I built it on my Linux system at home and it worked, even though
it was rather strict in the syntax it permitted. But, I've used the same
code here, built MLDBM with no errors, and I can't get it working past
the first level of referencing. 
	Can anyone point me in the right direction?

	Thanks in advance,

	Mike

-- 
Michael P. Soulier
1Z22, SKY
Tel: 613-765-4699 (ESN: 39-54699)
Email: msoulier@nortelnetworks.com
Carrier Packet Solutions
Nortel Networks Corporation
"...the word HACK is used as a verb to indicate a massive amount
of nerd-like effort."
   -Harley Hahn, A Student's Guide to UNIX


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

Date: Tue, 13 Apr 1999 20:41:18 GMT
From: skrana@my-dejanews.com
Subject: Need Perl Tutor - Naperville, IL
Message-Id: <7f0a5e$l7t$1@nnrp1.dejanews.com>





I want to learn PERL. I am in Naperville, IL.
If someone nearby has time in evenings and/or weekends,
please contact me.

S K Rana
630-983-7774 ext 26
630-579-1879 - Evening
rana@ostint.com

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


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

Date: Tue, 13 Apr 1999 19:53:47 GMT
From: kevin_collins@my-dejanews.com
Subject: Password change with Perl
Message-Id: <7f07c7$ih8$1@nnrp1.dejanews.com>

Can anyone tell me how I would use a Perl script to change a Unix password
using only standard Perl libraries? I don't want to have to install 'expect'
on all my machines to automate this process.

Thanks,

Kevin

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


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

Date: Tue, 13 Apr 1999 14:19:53 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Problem with my & local declarations
Message-Id: <3713B4F9.AF14A53E@mail.cor.epa.gov>

Mike Mckinney wrote:
> 
> I've written the following, but I can't seem to use either my or local to
> delcare the variables, because it either breaks the code entirely, or reports
> typographical errors. I realize the error is occuring because I'm using a
> naked block for a redo, but I carefully read up on it in Learning Perl, and I
> don't see why it won't work.

I read the thread you had with Eric, and I returned here so I could
point
out a minor change:

> Below is the code :
> 
> }
> sub CATALOG_ENTRY {

          my $title;    # now not local to the START: block

>         START : {
>         print "Enter the book title : ";
>         chomp( local $title = <STDIN> ); # can't use either my or local
>                    ^^^^^^^^^^^^

          chomp(       $title = <STDIN> );

>                    using either my or local keeps the variable from being used
>                    later within the same function, CATALOG_ENTRY, so when I try
>                    to join the variables, $title is undef

Right.  Solution: declare $title *outside* the START block.  Whenever
I have a problem with -w or 'use strict;' I fight my way to a solution,
rather than tell myself "Oh what the heck, it won't hurt to say 
'no strict vars;' for a while..."
 
>         open( BOOK_FILE, "books.pdb" ) || die "Couldn't open books.pdb: $!";
>         while( <BOOK_FILE> ) {
>                 if( /^$title:/i ) {
>                         print "You have already cataloged this book.\n";
>                         print "Start over ? ";
>                         chomp( my $repeat = <STDIN> );
>                         exit unless $repeat =~ /^y/i ;
>                         redo START;
>                 }
>         }
> }
>         print "Who is the Author : ";
>         chomp( my $author = <STDIN> );
>         print "Is it fiction or nonfiction : ";
>         chomp( my $fictionor = <STDIN> );
>         print "What type of book is it ( mystery, horror, scifi, etc.. ) : ";
>         chomp( my $classification = <STDIN> );
>         print "Enter a rating for the book ( 1-10 ) : ";
>         chomp( my $rating = <STDIN> );
>         @book = join( ":", $title,$author,$fictionor,$classification,$rating );
>         open( BOOK_FILE, ">>books.pdb" ) || die
>         "Couldn't open books.pdb : $! ";
>         print BOOK_FILE @book,"\n" ;
>         close( BOOK_FILE ) || warn "Couldn't close books.pdb : $! ";
> }
> 
> Any help or advice greatly appreciated.
> 

I hope this helps,
David
-- 
David Cassell, OAO                               
cassell@mail.cor.epa.gov
Senior Computing Specialist                          phone: (541)
754-4468
mathematical statistician                              fax: (541)
754-4716


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

Date: 13 Apr 1999 17:48:05 -0400
From: Uri Guttman <uri@home.sysarch.com>
Subject: Re: Problem with my & local declarations
Message-Id: <x7pv58nqei.fsf@home.sysarch.com>

>>>>> "DC" == David Cassell <cassell@mail.cor.epa.gov> writes:

  DC>           my $title;    # now not local to the START: block

  DC>           chomp(       $title = <STDIN> );

regardless of the scoping problem, declaring perl vars in expressions
like below is very ugly IMO. i don't even declaring like them in for
loops but that is much better than this.

  >> chomp( my $author = <STDIN> );

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: Tue, 13 Apr 1999 11:50:05 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: String matching
Message-Id: <d3pve7.sc5.ln@magna.metronet.com>

David Cantrell (NukeEmUp@ThePentagon.com) wrote:
: On Tue, 13 Apr 1999 14:43:37 +0300, "Ville Kemppinen"
: <vkemppin@comptel.com> enlightened us thusly:

: >
: >Hello!
: >
: >This is possibly a faq but anyway.

: Hmmm ... you are aware of the concept of FAQs and yet you still post
: your question without bothering to check if it is a FAQ or not?


   I think it was a great idea!

   He identified himself clearly as a "read the docs to me"
   type of "programmer", so I could immediately 
      *plonk*
   him.

   I am always on the lookout for ways to reduce the number of
   clpmisc Subject headers that I need to scan each day.

   Thanks Ville.


   :-)


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


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

Date: Tue, 13 Apr 1999 11:44:58 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: TPJ still shipping?
Message-Id: <qpove7.sc5.ln@magna.metronet.com>

Wappinger Mary (revjack@radix.net) wrote:
: Is The Perl Journal still shipping? I ordered a year's subscription and
: all the back issues almost a month ago, and I have yet to receive them.
: Mail to Mr. Orwant doesn't seem to be getting me anywhere.

: Has anyone else successfully purchased TPJ?


   I ordered all of the back issues on March 31, got them on 
   April 9.


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


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

Date: 13 Apr 1999 17:44:48 -0400
From: Uri Guttman <uri@home.sysarch.com>
Subject: Re: TPJ still shipping?
Message-Id: <x7soa4nqjz.fsf@home.sysarch.com>

>>>>> "TM" == Tad McClellan <tadmc@metronet.com> writes:

  TM> Wappinger Mary (revjack@radix.net) wrote:
  TM> : Is The Perl Journal still shipping? I ordered a year's subscription and
  TM> : all the back issues almost a month ago, and I have yet to receive them.
  TM> : Mail to Mr. Orwant doesn't seem to be getting me anywhere.

  TM> : Has anyone else successfully purchased TPJ?

  TM>    I ordered all of the back issues on March 31, got them on 
  TM>    April 9.

what's with all these orders for back issues?  you can't call yourselves
perl hackers if you haven't been charter subscribers from issue 1?
what's wrong with you?

:-)

uri, a charter subscriber, first (or very early) advertiser, ex-tech
editor of TPJ.


-- 
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: Tue, 13 Apr 1999 16:39:28 -0400
From: Diane Unger <geotrace@shentel.net>
Subject: what does this error msg mean?
Message-Id: <3713AB7F.4CB42F79@shentel.net>

I am using a variation of the Schwartzian Transform to sort some data
for display on a web page.  I keep getting the following error:

"map" may clash with future reserved word at /cgi-bin/logs.cgi line 232.

syntax error in file /cgi-bin/logs.cgi at line 232, next 2 tokens "map
{"
Execution of /cgi-bin/logs.cgi aborted due to compilation errors.
[Tue Apr 13 13:57:37 1999] [error] Premature end of script headers:
/usr/local/libexec/cgi-bin/rbox

Since map is supposed to be a recognized function, does this indicate
some other type of problem?  I'm stumped.  Here's a few lines around
where map is used in my perl code:

 ...
@sorted=();
@sorted=map {$_->[1]} sort {$a->[0] cmp $b->[0]} map
{[(split'|',$_)[1],$_]}@temp;

#split elements in @sorted, store current record as variable $i
foreach $i(@sorted)
{
print "$i\n";
etc.

Any suggestions on where to look for problems would be appreciated.
Thanks!
Dianee



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

Date: Tue, 13 Apr 1999 19:58:11 GMT
From: Marc.Haber-usenet@gmx.de (Marc Haber)
Subject: Re: Where we can get perl code snippets?
Message-Id: <7f07kk$e77$4@news.rz.uni-karlsruhe.de>

Tom Christiansen <tchrist@mox.perl.com> wrote:
>In comp.lang.perl.misc, 
>    =?euc-kr?B?udrBvrq5IChQYXJrLCBKb25nLVBvcmsp?= <okclub@communitech.net> writes:
>:Where is perl code snippets??
>
>Pelr examples are found at:
>
>    ftp://ftp.oreilly.com/published/oreilly/perl/cookbook/
>    http://language.perl.com/ppt/
>    http://www.perl.com/CPAN-local/authors/id/TOMC/scripts/

Also, Tom's "perl cookbook" is really excellent.

Greetings
Marc

-- 
-------------------------------------- !! No courtesy copies, please !! -----
Marc Haber          |   " Questions are the         | Mailadresse im Header
Karlsruhe, Germany  |     Beginning of Wisdom "     | Fon: *49 721 966 32 15
Nordisch by Nature  | Lt. Worf, TNG "Rightful Heir" | Fax: *49 721 966 31 29


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

Date: 13 Apr 1999 17:02:09 -0400
From: Uri Guttman <uri@home.sysarch.com>
Subject: Re: Where we can get perl code snippets?
Message-Id: <x7vhf0nsj2.fsf@home.sysarch.com>

>>>>> "A" == Abigail  <abigail@fnx.com> writes:

  A> =?euc-kr?B?udrBvrq5IChQYXJrLCBKb25nLVBvcmsp?= (okclub@communitech.net)
  A> wrote on MMLI September MCMXCIII in <URL:news:7eur74$ijo$1@news2.kornet.net>:
  A> ## Where is perl code snippets??

  A> I've some snippets:

maybe we should have a new perl op called 'snippet'? i don't know what
it will do but it should be related to split and splice!

:-)

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: 13 Apr 1999 20:41:34 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Win32 Mail Client
Message-Id: <7f0a5u$hm$1@gellyfish.btinternet.com>

In comp.lang.perl.misc Greg Griffiths <greg2@surfaid.org> wrote:
> I'm not allowed due to server restrictions to use anything that is not
> in the base install of the language. So I guess that rules out blat.
> 

Ooh nasty.  I cant even recommend the next fallbacks as described in
perlfaq9 as this will require the installation of some modules.

If you go to the ActiveState site and poke around a bit you will find a 
link to some other site that has one or two suggestions ... Sorry to be
vague but I'm watching part II of 'Great Expectations'.

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


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

Date: 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 5375
**************************************

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