[25577] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 7821 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Feb 23 18:05:41 2005

Date: Wed, 23 Feb 2005 15:05:20 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 23 Feb 2005     Volume: 10 Number: 7821

Today's topics:
    Re: Annoying Problem with a Basic Perl app and XP Pro <wyzelli@yahoo.com>
    Re: BerkeleyDB locking question <dwilga-MUNGE@mtholyoke.edu>
    Re: Comparing huge XML Files <junnuthula@yahoo.com>
    Re: Credit cards storage <zebee@zip.com.au>
    Re: FAQ 4.12 How do I find the day or week of the year? <jgibson@mail.arc.nasa.gov>
        file parsing.. clearguy02@yahoo.com
    Re: file parsing.. <jl_post@hotmail.com>
    Re: file parsing.. <jl_post@hotmail.com>
    Re: file parsing.. <kkeller-usenet@wombat.san-francisco.ca.us>
    Re: file parsing.. <someone@example.com>
    Re: FTP from macro <jpmythic@ntlworld.com>
        module installing <emanuele.matli@cern.ch>
    Re: module installing <spamtrap@dot-app.org>
    Re: Need help with CGI/ DBI error (permissions?) <dha@panix.com>
    Re: Need help with CGI/ DBI error (permissions?) <1usa@llenroc.ude.invalid>
    Re: OT: Re: standard mode for arrow down <svein.ove@aas.no>
    Re: Perl DBI and Microsoft Access nathaniel_welch@hotmail.com
    Re: Perl DBI and Microsoft Access <1usa@llenroc.ude.invalid>
    Re: regexp <abigail@abigail.nl>
    Re: standard mode for arrow down <john.thingstad@chello.no>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Wed, 23 Feb 2005 22:33:27 GMT
From: "Peter Wyzl" <wyzelli@yahoo.com>
Subject: Re: Annoying Problem with a Basic Perl app and XP Pro
Message-Id: <Xw7Td.172774$K7.53800@news-server.bigpond.net.au>

"arek" <jpmythic@ntlworld.com> wrote in message
news:1109158855.718500.172280@o13g2000cwo.googlegroups.com...
> One Note to other users of Perl:
>
> XP Pro is far more strict in access to files and other things then XP
> Home...
> Be careful when writing apps and testing them on one then trying to run
> them on another
>
> What may run without problems on XP Home, may not necessarily run on XP
> Pro.
>
> The actual problem was in Accessing File Attributes in XP Pro...
> XP Pro requires Opening the File Before attempting to read Attributes..

That is simply not true.  If you believe it to be so, post a short (10 lines
or so) working program that demonstrates a requirement to open a file before
stat will work.

I use XP Pro with both fat32 and NTFS.  I have never needed to open a file
to stat it.

Maybe you have some other problem?

P
--
print "Just another Perl hacker\n";




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

Date: Wed, 23 Feb 2005 14:11:37 -0500
From: Dan Wilga <dwilga-MUNGE@mtholyoke.edu>
Subject: Re: BerkeleyDB locking question
Message-Id: <dwilga-MUNGE-8DFAD3.14113623022005@nap.mtholyoke.edu>

In article <C86dnXwrBrIK84HfRVnygQ@giganews.com>,
 "Mark" <admin@asarian-host.net> wrote:

> "Paul Marquess" <Paul.Marquess@btinternet.com> wrote in message 
> news:3833e5F5fj92fU1@individual.net...
> 
> > The simplest form of locking available in Berkeley DB is called
> > Concurrent Data Store CDS. It allows single writer, multiple readers.
> 
> Just what the doctor ordered! :) Thank you!

Just one caveat: Don't do this when multiple processes on different 
machines need to access the same data (via NFS, for example). Berkeley 
DB uses per-machine IPC for locking.

-- 
Dan Wilga          dwilga-MUNGE@mtholyoke.edu
** Remove the -MUNGE in my address to reply **


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

Date: 23 Feb 2005 12:45:16 -0800
From: "junnuthala" <junnuthula@yahoo.com>
Subject: Re: Comparing huge XML Files
Message-Id: <1109191516.171635.61060@l41g2000cwc.googlegroups.com>

I don't want to use the Unix diff.

I wanted to parse and read the XML elements, attributes text into a
tree or a hash and then compare.

I tried using Semanticdiff, but it is taking a lot of time to read the
XML file into Hash.



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

Date: Wed, 23 Feb 2005 19:19:05 GMT
From: Zebee Johnstone <zebee@zip.com.au>
Subject: Re: Credit cards storage
Message-Id: <slrnd1plge.b5h.zebee@zeus.zipworld.com.au>

In comp.lang.perl.misc on 23 Feb 2005 08:34:18 -0800
saidev@gmail.com <saidev@gmail.com> wrote:
> Just want to get some ideas on how everyone store Credit Card
> information into MySQL.  I know I can't use the one way encryption, if
> the customer come back, I won't be able to provide the correct
> information to the bank.  What is the safest way to store user CC
> information?  I'll be modifying an existance Perl program to do this,
> any modules can help me do this?  Thanks.


DOn't do it.

It really isn't worth it.

You customer can type the card number in again, won't kill them.  And
you are saved from a lot of liability.

Zebee

-- 
Zebee Johnstone (zebee@zip.com.au), proud holder of
aus.motorcycles Poser Permit #1.
"Motorcycles are like peanuts... who can stop at just one?"


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

Date: Wed, 23 Feb 2005 11:42:14 -0800
From: Jim Gibson <jgibson@mail.arc.nasa.gov>
Subject: Re: FAQ 4.12 How do I find the day or week of the year?
Message-Id: <230220051142143651%jgibson@mail.arc.nasa.gov>

In article <cvgdn5$g66$1@reader2.panix.com>, PerlFAQ Server
<comdog@panix.com> wrote:

> This message is one of several periodic postings to comp.lang.perl.misc
> intended to make it easier for perl programmers to find answers to
> common questions. The core of this message represents an excerpt
> from the documentation provided with Perl.
> 
> --------------------------------------------------------------------
> 
> 4.12: How do I find the day or week of the year?
> 
>     The localtime function returns the day of the week. Without an argument
>     localtime uses the current time.

Shouldn't this be:

   The localtime function returns the day of the week and the day 
   of the year. Without an argument, localtime uses the current time.

> 
>         $day_of_year = (localtime)[7];

and maybe:

   ($day_of_week, $day_of_year) = (localtime)[6,7];

----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----


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

Date: 23 Feb 2005 11:50:15 -0800
From: clearguy02@yahoo.com
Subject: file parsing..
Message-Id: <1109188215.923039.18540@g14g2000cwa.googlegroups.com>

Hi experts,

I have below script and I need to translate a full name to a login ID.

===========================================
while (<DATA>)
  {
   ($last, $first) = split ("\s+", $_);
   $login = $first[0] . $last;
   print "$login\n";
  }

__DATA__
Smith Bob
Carter John
Fisher Ann
Lewis Maggy
=======================================

Output should be:
===============
bsmith
jcarter
afisher
mlewis
=============

How can I modify the aboe script to get the desired output?

Thanks,
Rider.



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

Date: 23 Feb 2005 12:00:27 -0800
From: "jl_post@hotmail.com" <jl_post@hotmail.com>
Subject: Re: file parsing..
Message-Id: <1109188827.744838.139430@z14g2000cwz.googlegroups.com>

cleargu...@yahoo.com wrote:
> I have below script and I need to translate a
> full name to a login ID.
>
> ===========================================
> while (<DATA>)
>   {
>    ($last, $first) = split ("\s+", $_);
>    $login = $first[0] . $last;
>    print "$login\n";
>   }
>
> __DATA__
> Smith Bob
> Carter John
> Fisher Ann
> Lewis Maggy
> =======================================
>
> Output should be:
> ===============
> bsmith
> jcarter
> afisher
> mlewis
> =============
>
> How can I modify the aboe script to get the desired output?


Dear Rider,

   First, know that just using split() with no parameters is almost the
same as:

      split(/\s+/, $_)

   Second, saying $first[0] does NOT give you the first letter of the
$first variable.  Instead it gives you the first ELEMENT of the @first
ARRAY.  To get the first letter of the $first variable, use substr()
instead, like this:

      substr($first, 0, 1)

   Therefore, I think this code will do exactly what you want:

while (<DATA>)
{
   ($last, $first) = split;
   $login = substr($first, 0, 1) . $last;
   print "$login\n";
}
__DATA__
Smith Bob
Carter John
Fisher Ann
Lewis Maggy
=======================================


   I hope this helps, Rider.

   -- Jean-Luc



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

Date: 23 Feb 2005 12:06:19 -0800
From: "jl_post@hotmail.com" <jl_post@hotmail.com>
Subject: Re: file parsing..
Message-Id: <1109189179.375046.24500@o13g2000cwo.googlegroups.com>

I forgot to mention:

You probably want to add the line:

      $login = lc($login);

before the print() statement so that all your usernames come out in
lower-case letters.



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

Date: Wed, 23 Feb 2005 12:12:02 -0800
From: Keith Keller <kkeller-usenet@wombat.san-francisco.ca.us>
Subject: Re: file parsing..
Message-Id: <il4ve2x5n2.ln2@goaway.wombat.san-francisco.ca.us>

On 2005-02-23, clearguy02@yahoo.com <clearguy02@yahoo.com> wrote:
>
> I have below script and I need to translate a full name to a login ID.

Try your script with

use strict;
use warnings;

At least two of the reported errors are relevant to why you're not
getting the output you desire.

>===========================================
> while (<DATA>)
>   {
>    ($last, $first) = split ("\s+", $_);
>    $login = $first[0] . $last;
>    print "$login\n";
>   }
>
> __DATA__
> Smith Bob
> Carter John
> Fisher Ann
> Lewis Maggy
>=======================================

--keith

-- 
kkeller-usenet@wombat.san-francisco.ca.us
(try just my userid to email me)
AOLSFAQ=http://wombat.san-francisco.ca.us/cgi-bin/fom
see X- headers for PGP signature information



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

Date: Wed, 23 Feb 2005 21:50:13 GMT
From: "John W. Krahn" <someone@example.com>
Subject: Re: file parsing..
Message-Id: <pU6Td.24716$0h.18095@clgrps13>

clearguy02@yahoo.com wrote:
> 
> I have below script and I need to translate a full name to a login ID.
> 
> ===========================================
> while (<DATA>)
>   {
>    ($last, $first) = split ("\s+", $_);
>    $login = $first[0] . $last;
>    print "$login\n";
>   }
> 
> __DATA__
> Smith Bob
> Carter John
> Fisher Ann
> Lewis Maggy
> =======================================
> 
> Output should be:
> ===============
> bsmith
> jcarter
> afisher
> mlewis
> =============
> 
> How can I modify the aboe script to get the desired output?

while ( <DATA> ) {
     my ( $last, $login ) = map lc, split;
     substr( $login, 1 ) = $last;
     print "$login\n";
     }

__DATA__
Smith Bob
Carter John
Fisher Ann
Lewis Maggy



John
-- 
use Perl;
program
fulfillment


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

Date: 23 Feb 2005 14:15:10 -0800
From: "arek" <jpmythic@ntlworld.com>
Subject: Re: FTP from macro
Message-Id: <1109196910.256328.284500@l41g2000cwc.googlegroups.com>

Actually my mistake...
The Author had updated the AutoFtp.pl file to work with the newer
Net::FTP
I had originally worked with the earlier one he did, then later
utilized this
latest version.

It is very well commented and easy to follow and understand.

But don't take my word for it, check it out and see for yourself.



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

Date: Wed, 23 Feb 2005 20:30:33 +0100
From: Emanuele Matli <emanuele.matli@cern.ch>
Subject: module installing
Message-Id: <cvil5l$ju1$1@sunnews.cern.ch>

Hello,

I have a problem installing a (perl) module on my iBook (MAC OSX 10.3.8, 
perl v5.8.1-RC3). The error message is the following:

Error: Unable to locate installed Perl libraries or Perl source code.

It is recommended that you install perl in a standard location before
building extensions. Some precompiled versions of perl do not contain
these header files, so you cannot build extensions. In such a case,
please build and install your perl from a fresh perl distribution. It
usually solves this kind of problem.

(You get this message, because MakeMaker could not find 
"/System/Library/Perl/5.8.1/darwin-thread-multi-2level/CORE/perl.h")

and the module I'm trying to install is the File::List from CPAN.

This actually rise from another problem that is: I get a malloc error 
from Glob (*** malloc[2302]: error for object 0xbffffe20: Pointer being 
reallocated was not allocated
Out of memory! ), but only if I call it twice. The first call is succesfull.

Any suggestion on how to solve one or both of these problems?

Thanks,

E.


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

Date: Wed, 23 Feb 2005 15:07:20 -0500
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: module installing
Message-Id: <-qWdnR5nqKHlf4HfRVn-3A@adelphia.com>

Emanuele Matli wrote:

> I have a problem installing a (perl) module on my iBook (MAC OSX 10.3.8,
> perl v5.8.1-RC3). The error message is the following:
> 
> Error: Unable to locate installed Perl libraries or Perl source code.

You need to install Xcode.

sherm--

-- 
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org


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

Date: Wed, 23 Feb 2005 21:55:49 +0000 (UTC)
From: "David H. Adler" <dha@panix.com>
Subject: Re: Need help with CGI/ DBI error (permissions?)
Message-Id: <slrnd1puv5.n07.dha@panix2.panix.com>

On 2005-02-23, patrickg <pat@patmail.com> wrote:
>
> "A. Sinan Unur" <1usa@llenroc.ude.invalid> wrote in message
> news:Xns96059D1E83AE1asu1cornelledu@132.236.56.8...

>> So, I went to <URL: http://www.google.com/>, typed in
>>
>> perl iis oracle
>>
> <snip>

> 2) If the solution were so obvious to you, why didn't just give it instead
> of all the previous BS?

I think Sinan's point was that *you* could have searched google in the
first place, rather than asking your question to thousands of people
around the world.

dha

-- 
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
"It's all eggs, bacon, beans and a fried slice." - Madness


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

Date: Wed, 23 Feb 2005 22:23:14 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Need help with CGI/ DBI error (permissions?)
Message-Id: <Xns9606B0E0B76F6asu1cornelledu@127.0.0.1>

"David H. Adler" <dha@panix.com> wrote in
news:slrnd1puv5.n07.dha@panix2.panix.com: 

> On 2005-02-23, patrickg <pat@patmail.com> wrote:
>>
>> "A. Sinan Unur" <1usa@llenroc.ude.invalid> wrote in message
>> news:Xns96059D1E83AE1asu1cornelledu@132.236.56.8...
> 
>>> So, I went to <URL: http://www.google.com/>, typed in
>>>
>>> perl iis oracle
>>>
>> <snip>
> 
>> 2) If the solution were so obvious to you, why didn't just give it
>> instead of all the previous BS?
> 
> I think Sinan's point was that *you* could have searched google in the
> first place, rather than asking your question to thousands of people
> around the world.

Thank you for the clarification.

As well as the additional point that the keywords you enter in Google 
for a good match are not the criterion by which we judge topicality. The 
OP's problem description specifically included the statement that his 
script ran fine from the command line (i.e. under his permissions) and 
did not when invoked via CGI (i.e. under the web server's permissions).

Such problems are caused by differing permissions which fall strictly 
under the topic of configuration.

Of course, it is fine to be confused at first. What is not _acceptable_ 
is to react harshly when it is repeatedly pointed out that the solution 
lies elsewhere.

Sinan.

PS to the OP: If you do not want my help, then feel free to ignore it. 
Also, I do not understand your comment regarding Turkey.


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

Date: Wed, 23 Feb 2005 22:59:57 +0100
From: Svein Ove Aas <svein.ove@aas.no>
Subject: Re: OT: Re: standard mode for arrow down
Message-Id: <cviucr$t02$1@services.kq.no>

RedGrittyBrick wrote:

> Xah Lee wrote:
>> Computing Folks of the industry:
>> 
>> please spread the debunking of the truncating line business of the
>> fucking unix-loving fuckheads, as outlines here:
>>  http://xahlee.org/UnixResource_dir/writ/truncate_line.html
>> 
> 
> <rant deleted>
> 
> What do I find Xah Lee has prepared at the above URL? text presented in
> one HTML PRE tag with containing the very newline characters that cause
> Xah Lee to foam at the mouth!
> 
Actually, as I understand the page, he did that on purpose, to make a point.
It happens to be a point I agree with, but that battle was lost 30 years
ago...


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

Date: 23 Feb 2005 14:22:04 -0800
From: nathaniel_welch@hotmail.com
Subject: Re: Perl DBI and Microsoft Access
Message-Id: <1109197324.386745.49340@f14g2000cwb.googlegroups.com>

Sorry, They just don't have the DBI module installed.

-Nate



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

Date: Wed, 23 Feb 2005 22:32:07 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Perl DBI and Microsoft Access
Message-Id: <Xns9606B2628FB97asu1cornelledu@127.0.0.1>

nathaniel_welch@hotmail.com wrote in news:1109197324.386745.49340
@f14g2000cwb.googlegroups.com:

[ Please quote some context when you are responding ]

"A. Sinan Unur" <1usa@llenroc.ude.invalid> wrote in
news:Xns960652D5D96FCasu1cornelledu@127.0.0.1: 

> nathaniel_welch@hotmail.com wrote in news:1109163770.786742.76130
> @z14g2000cwz.googlegroups.com:
> 
>> I have several CGI scripts that interface with several Microsoft
>> Access databases using DBI.  I just purchased space on a remote web
>> server and uplodaed all my files.  It turns out that this server
>> doesn't support DBI. 
> 
> Well, I am not sure what you mean by they don't support DBI. Do they
> just not have the DBI module installed, or is this a *nix system
> without DBD- ODBC and an ODBC driver? If it is the latter, have you
> read the FAQ at <URL:
> http://search.cpan.org/~jurl/DBD-ODBC-1.13/ODBC.pm>? 
>
> Sorry, They just don't have the DBI module installed.
> 

Well, I have not worked with Access databases in Perl at all. However, 
just reading the DBD-ODBC documentation indicates to me that this is 
going to be tricky to get working in a *nix environment. Does your 
hosting company use Windows? 

If that is the case, I would suggest installing on another computer the 
exact same version of Perl they are using (let's hope it is one of 
ActiveStates). Then, installing all the Perl components needed to get 
your Access access working (using ppm, hopefully). Then, putting all the 
files installed during that process into a private directory under your 
account (keeping the relative paths intact) and then putting that 
directory in the search path using 

use lib 'path to installation dir';

See also:

perldoc -q lib.

However, before doing this much work, I would seriously invastigate the 
possibility of getting them to do it for you.

If this is a *nix account, my reading of the DBD-ODBC docs suggests that 
it will be considerably harder to get things running, but I do not know 
much about this stuff.

Good luck.

Sinan.


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

Date: 23 Feb 2005 22:39:04 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: regexp
Message-Id: <slrnd1q1g7.p92.abigail@alexandra.abigail.nl>

Gunnar Hjalmarsson (noreply@gunnar.cc) wrote on MMMMCXCIV September
MCMXCIII in <URL:news:383jofF5h5m1lU1@individual.net>:
,,  Arndt Jonasson wrote:
,, > Alexandre Jaquet <alexj@floor.ch> writes:
,, >> Hi does someone could clear my mind and tell me what would mean :
,, >>
,, >> $loop_hs =~ s/\$HTML{\'$noteval\'}/\*HTML{\'$noteval\'}/g;
,, > 
,, > It assumes that the variable $noteval has a value; let's say it contains
,, > "foo".
,, > 
,, > Then the statement takes the string $loop_hs and in it replaces all
,, > occurrences of the character '$' with '*' when they are followed by
,, > "HTML{'foo'}".
,,  
,,  Since there are several redundant backslashes, i.e.
,,  
,,       $loop_hs =~ s/\$HTML{'$noteval'}/*HTML{'$noteval'}/g;


I'd write it as:

    $loop_hs =~ s/\$(?=HTML{'$noteval'}/*/g;


(assuming that $noteval doesn't contain regexp-meta-characters)


Abigail
-- 
$" = "/"; split // => eval join "+" => 1 .. 7;
*{"@_"} = sub {foreach (sort keys %_) {print "$_ $_{$_} "}};
%_ = (Just => another => Perl => Hacker); &{%_};


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

Date: Wed, 23 Feb 2005 20:41:02 +0100
From: "John Thingstad" <john.thingstad@chello.no>
Subject: Re: standard mode for arrow down
Message-Id: <opsmn0yof8pqzri1@mjolner.upc.no>

On 23 Feb 2005 17:59:24 +0100, Pascal Bourguignon <spam@mouse-potato.com>  
wrote:

>
> "Xah Lee" <xah@xahlee.org> writes:
>> However, as of today, emacs don't really have reason to have arrow-down
>> behavior to be dependent on the hard-coded line wraps. I want the next
>> emacs version's down-arrow behavior to be fixed. (and optionally as
>> another mode to move by EOL.)
>
> Dear Xah,
>
> Did you notice that emacs is highly customizable, and that you can
> easily program a command to have the arrow-down behave exactly like
> you want?  I'd even bet that there's already flowing somewhere on the
> net some emacs lisp code to do that.
>
> In anycase, try to program it: it'll prove more pleasurable than
> writting these pamphlets...
>

I noticed he wrote it as a question without the rant on comp.emacs
and got some code to work in this fashion.

Remember that Xah Lee is troll (and confesses to this himself)

-- 
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/


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

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc.  For subscription or unsubscription requests, send
#the single line:
#
#	subscribe perl-users
#or:
#	unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

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.

#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 V10 Issue 7821
***************************************


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