[22088] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4310 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Dec 24 14:05:47 2002

Date: Tue, 24 Dec 2002 11:05:08 -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           Tue, 24 Dec 2002     Volume: 10 Number: 4310

Today's topics:
    Re: advice - gui-ish programming (Glenn Becker)
        Autofillin login popup on the web. (Pims.post)
    Re: Autofillin login popup on the web. (Tad McClellan)
    Re: csv file to mysql import <cpryce@pryce.nospam.net>
    Re: File::Find module ; want to resume search from poin <bart.lateur@pandora.be>
    Re: Generalising a function was: Re: how to read(string (Tad McClellan)
        How to begin a File Comparison <lou.moran@gellerandwind.com>
    Re: How to begin a File Comparison <lou.moran@gellerandwind.com>
    Re: Is it safe to return a reference to local or lexica <mgjv@tradingpost.com.au>
    Re: Merry Christmas <clay@panix.com>
    Re: Merry Christmas <jeff@vpservices.com>
    Re: Merry Christmas <alecler@sympatico.ca>
    Re: Perl Vs PHP <willis3140@com.yahoo>
    Re: Processing \0xx in nonliteral strings <krahnj@acm.org>
    Re: re splitting up a file <bart.lateur@pandora.be>
    Re: re splitting up a file (Tad McClellan)
    Re: regular expression help (Mark)
    Re: SOS: evaluate a string/function (Greg)
    Re: Stat() function not working.  Kind of... (Mac)
        test bps103@hotmail.com
    Re: Using XML Simple to Define variables <cpryce@pryce.nospam.net>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 24 Dec 2002 09:26:21 -0800
From: burningclown@burningclown.com (Glenn Becker)
Subject: Re: advice - gui-ish programming
Message-Id: <5f296f13.0212240926.5f2720c0@posting.google.com>

kevin <web0001@flactem.com> proclaimed:

> I'm totally fed up with the M$ platform, and I want to learn to program 
> gui apps for linux.  

Saw this, looked at the followups. What kind of app are you interested
in trying? I've been thinking about trying an astronomy application
for Linux - more specifically an "observation planner" package that
will be spreadsheet-based and involve big-ass db work. For an example
of a Win program that does this, see

http://www.deepsky2002.net/features.html (this is pulled from a
frameset, btw)

I hadn't thought about using Perl & am in no way a Perl master. But
I've been searching for a project to bootstrap myself to any kind of
expertise in coding. Would this interest you at all?

Glenn Becker
burningclown@burningclown.com


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

Date: 24 Dec 2002 08:45:36 -0800
From: pims.post@hccnet.nl (Pims.post)
Subject: Autofillin login popup on the web.
Message-Id: <45ae9146.0212240845.1e9f17ee@posting.google.com>

Hello,

is it possible to fillin a popup login create from your webbrowser?
I don't have technical access to the site. But it prompts me for my
login and password.
Is there a perl program around which recognizes such login and is able
to fillin the fields and gets me.
I'm trying to write an end to end testing program.

Anybody???

regards,
Pim


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

Date: Tue, 24 Dec 2002 11:31:34 -0600
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Autofillin login popup on the web.
Message-Id: <slrnb0h6fm.ida.tadmc@magna.augustmail.com>

Pims.post <pims.post@hccnet.nl> wrote:

> it prompts me for my
> login and password.
> Is there a perl program around which recognizes such login and is able
> to fillin the fields and gets me.


   use LWP::UserAgent;


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Tue, 24 Dec 2002 15:30:11 GMT
From: cp <cpryce@pryce.nospam.net>
Subject: Re: csv file to mysql import
Message-Id: <241220020936110653%cpryce@pryce.nospam.net>

In article <a75562ad.0212190555.47287674@posting.google.com>, Arunav
Mandal <dibun@hotmail.com> wrote:

> I am trying to import the csv style address book in mysql database
> with the following script but it always inserts a blank row everytime
> I run the perl script. Can I anybody let me know where is the problem?


It's not a strictly perl answer, but if you are using MySQL, you could
use the LOAD DATA INFILE function. See the MySQL docs. 

From the Perl DBI you can call the function with do().

-- 
cp

remove 'nospam' to reply


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

Date: Tue, 24 Dec 2002 11:07:05 GMT
From: Bart Lateur <bart.lateur@pandora.be>
Subject: Re: File::Find module ; want to resume search from point of failure.
Message-Id: <tmeg0vk99dq2pjf5ltdc53t0jt2r5p2n0l@4ax.com>

Mitchell Laks wrote:

>what algorithm does file::find use to order the directories and
>subdirectories

Basically, for each directory it will first process the directory
itself, next the normal files, and finally, descend into its
subdirectories, recursively. And repeat. So the order is:

	/path/to/dir
	/path/to/dir/file1
	/path/to/dir/file2
	/path/to/dir/subdir1
	/path/to/dir/subdir1/file1
	/path/to/dir/subdir1/file2
	/path/to/dir/subdir2
	/path/to/dir/subdir2/file1
	/path/to/dir/subdir2/file2
	/path/to/dir/subdir2/subdir3
	/path/to/dir/subdir2/subdir3/file1
	/path/to/dir/subdir2/subdir3/file2


That means that when the directory gets logged, the script is only
starting with this directory.

The *order* in which the files per directory are processed, is almost
random: it's the same order as readdir() returns the files in, for a not
so suprising reason. But that order is defined by the order the
filenames are physically stored on disk. For Windows/DOS, for example,
that means that newer file names are added at the end, except that holes
left by deleted entries (deleted or moved files/directories) are filled
first. In summary: it's all fairly unreliable. I think you ought to log
which files got processed already, too.

There's also an alterative sub to find: finddepth. That will process the
files in a subdirectory before it'll process the subdirectory itself.

-- 
	Bart.


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

Date: Tue, 24 Dec 2002 08:09:33 -0600
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Generalising a function was: Re: how to read(string) instead of read(STDIN)?
Message-Id: <slrnb0gqkt.hst.tadmc@magna.augustmail.com>

Marcus <marc@nospam.com> wrote:
> Bart Lateur <bart.lateur@pandora.be> wrote in message
> news:fsud0vkoh80q86r9luctmpkms4bie9qr44@4ax.com...
>> Marcus wrote:
>>
>> >I'm trying to make a while loop like this:
> "while(read(STDIN,$q,$w=3)){...}"
>> >except I'd like to use a string instead of STDIN.


[snipped what Bart wrote]

> Can anyone tell me how to
> generalise read2, so I don't have to always use $_ and $w as inputs?


You already don't have to choose "w" as the name of your variable,
so that part is already handled.

All that's left is to be able to modify the contents of whatever
variable is used as the 2nd argument.

You can do that by adding 3 characters.  :-)


> while(read2($text,$_,$w=3))  #$w characters of STDIN


> sub read2 {
>   ($text,$_, $w) = @_;


No longer need a copy of the 2nd arg, because we wish to
modify it "in place":

   my($text, undef, $w) = @_;


>       $_ = substr($text,$position,length($text)-$position);


Modify the 2nd argument in-place (as described in "perldoc perlsub"):

   $_[1] = substr($text,$position,length($text)-$position);



Your prolific use of global variables is worrisome, as is your
use of package variables when lexical variables will do.

Consider fixing those aspects if you're going to use this
in production code.


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Tue, 24 Dec 2002 12:56:10 -0500
From: Lou Moran <lou.moran@gellerandwind.com>
Subject: How to begin a File Comparison
Message-Id: <137h0vgq9uit95l05k3m0b3g2j2g6n8ro2@4ax.com>

The Story:

There was a secretary who made a list of Names & Addresses.  These
names and addresses are in no particular format and often deviate from
even the most sensical envelope type format,  A new secretary was
added to the mix.  She took a copy of the orginal file and began
adding to it while the original secretary continued added to her
original list.  They don't like each other and never speak.  Ever.

The Idea:

Get these massive files into some kind of format suitable for import
into a database.

The Task:

1 -- Do some sort of File Compare to weed out duplicates

2 -- Do some sort of Formatting to attempt to get these in some kind
of order

3 -- Merge the files into one big, happy, database importable file

(Perhaps 1 & 2 are backwards)

I certainly do expect anyone to write anything (code wise) I just need
some ideas on how to approach this project;  Modules, correct way to
look at this, best practices type of stuff.  I should mention that we
are actually talking about more than 2 files, but I plan to start on
the big ones first.

The originals are in Word Perfect and the only way to tell a file from
the next is a Page Break.  I have the files in .txt with line breaks
at the moment.

All suggestions welcome (Please be nice it's the Holidays!)

--
There's more than one way to do it, but only some of them work


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

Date: Tue, 24 Dec 2002 13:53:16 -0500
From: Lou Moran <lou.moran@gellerandwind.com>
Subject: Re: How to begin a File Comparison
Message-Id: <a7bh0vkpg5ki2rffpjptfgi2ef89m23akj@4ax.com>

On Tue, 24 Dec 2002 12:56:10 -0500, Lou Moran
<lou.moran@gellerandwind.com> wrote:

ACK!
>I certainly do expect anyone to write anything (code wise) I just need

I do not, DO NOT expect anyone to write anything....

(man this thing needs a preview button :)


--
There's more than one way to do it, but only some of them work


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

Date: Wed, 25 Dec 2002 00:11:54 +1100
From: Martien Verbruggen <mgjv@tradingpost.com.au>
Subject: Re: Is it safe to return a reference to local or lexical data?
Message-Id: <slrnb0gn8q.aid.mgjv@martien.heliotrope.home>

On Tue, 24 Dec 2002 05:56:07 -0500,
	Andrew Lee <andrew_lee@earthlink.net> wrote:
> On Tue, 17 Dec 2002 22:08:16 GMT, Martien Verbruggen
><mgjv@tradingpost.com.au> wrote:
> 
>>On Tue, 17 Dec 2002 09:36:28 -0500,
>>	Christian Caron <nospam@nospam.org> wrote:
>>> 
>>> "Tad McClellan" <tadmc@augustmail.com> wrote in message
>>> news:slrnavub72.2nm.tadmc@magna.augustmail.com...
>>>> Christian Caron <nospam@nospam.org> wrote:
>>>> >
>>>> >>
>>>> >> 3.18: Is it safe to return a reference to local or lexical data?

[snip lengthy discussion]

> Isn't this way to much discussion for a faulted FAQ posting?  Or am I
> (like the original poster) seeing the Emperor with no clothes?

Faulted in what way? There were some improvements suggested. Most of the
discussion that followed was to explain a misunderstanding that someone
had about how it all worked.

> If I posted that code I would be shouted down for not testing it
> before posting -- in that sense it is in error.

The poster with the query did test, they just didn't understand how it
worked. 

We could have referred to perldsc, perllol, and perlref, but I doubt
very much that anyone with a serious question about how things work gets
shouted down very much here. There are several levels of helpfulness,
but very few people "shout down" others.

I do hope we're not going to get into one of these "clp.misc is such an
unhelpful and hostile place" discussions, because I'm thoroughly sick of
those. The only thing they accomplish is that several people sharpen
their score files.

Martien
-- 
                        | 
Martien Verbruggen      | For heaven's sake, don't TRY to be cynical.
                        | It's perfectly easy to be cynical.
                        | 


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

Date: Tue, 24 Dec 2002 15:41:47 +0000 (UTC)
From: Clay Irving <clay@panix.com>
Subject: Re: Merry Christmas
Message-Id: <slrnb0h01r.nq1.clay@panix3.panix.com>

In article <slrnb0ger3.13t.bernard.el-hagin@gdndev25.lido-tech>, 
Bernard El-Hagin wrote:

> I'd like to wish all the regulars and all the lurkers of CLPM a very:
> 
> 
> perl -e 'print "M$0-r-r-y C-h-r-i-s-t-m-a-s\n"'

#!/usr/local/bin/perl

while (<DATA>) {
    $l = chr($_);
    print "$l"
}

print "\n";

__DATA__
77
101
114
114
121
32
67
104
114
105
115
116
109
97
115
32
97
110
100
32
97
32
72
97
112
112
121
32
78
101
119
32
89
101
97
114
33

-- 
Clay Irving <clay@panix.com>
I'm so thirsty I'd lick the water out of Clinton's diarrhea...
I'm sorry if I grossed you out.  I shouldn't have used Clinton..


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

Date: Tue, 24 Dec 2002 10:28:39 -0800
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: Merry Christmas
Message-Id: <3E08A757.3040907@vpservices.com>

Bernard El-Hagin wrote:

> I'd like to wish all the regulars and all the lurkers of CLPM a very:
> 
> 
> perl -e 'print "M$0-r-r-y C-h-r-i-s-t-m-a-s\n"'
> 

And a belated merry Ramadan, Kwanza, and Hanukkah too.

   for(1..8) {
     light_candle($_);
   }

-- 
Jeff



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

Date: Tue, 24 Dec 2002 13:46:36 -0500
From: Andre <alecler@sympatico.ca>
Subject: Re: Merry Christmas
Message-Id: <alecler-75941C.13463624122002@news1.qc.sympatico.ca>

In article <3E08A757.3040907@vpservices.com>, Jeff Zucker 
<jeff@vpservices.com> wrote:

> Bernard El-Hagin wrote:
> 
> > I'd like to wish all the regulars and all the lurkers of CLPM a very:
> > 
> > 
> > perl -e 'print "M$0-r-r-y C-h-r-i-s-t-m-a-s\n"'
> > 
> 
> And a belated merry Ramadan, Kwanza, and Hanukkah too.
> 
>    for(1..8) {
>      light_candle($_);
>    }

And, of course, a Happy Ordinary Day for those of us who are not 
religious. :-)

Andre


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

Date: Tue, 24 Dec 2002 14:30:06 GMT
From: w i l l <willis3140@com.yahoo>
Subject: Re: Perl Vs PHP
Message-Id: <lerg0vshkls3feskeepqok6s1q4il9490d@4ax.com>

On Tue, 24 Dec 2002 09:08:57 +0530, "Kasp" <kasp@NO_SPAMepatra.com>
wrote:

>I would like to know your opinion on whether Perl or PHP is better?
>Lately, more people are looking into PHP. Why?
>



I was new to programming a year or so ago, till I got a perl book.
I've been programming ever since. Don't limit yourself to PHP. I once
heard PHP referred to as "the training wheels without the bike" or
something along those lines. If you want to learn a language learn one
that will be of use to you no matter what environment you're in.

A better question would be, "Why not use perl?"


-W i l l


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

Date: Tue, 24 Dec 2002 12:23:39 GMT
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: Processing \0xx in nonliteral strings
Message-Id: <3E08516F.4084F611@acm.org>

Moshe Jacobson wrote:
> 
> Hello all, I hope you can answer this somewhat difficult question:
> 
> I'm trying to take a user-provided format string, and provide an
> output string with various %-macros replaced with application-specific
> data, and also with \n, \r, \0xx, etc backslash escapes expanded as
> well.
> 
> Currently, I have the following code:
> 
> my $fmt = "user: %u\ndomain:%d\n"; # example
> my $str = "";
> my @chars = split "", $fmt;
> for(my $i = 0; $i < @chars; $i++) {
>     if($chars[$i] ne "%" and $chars[$i] ne "\\") { $str .= $chars[$i]; next; }
>     $i++;
>     if($i == @chars) { $str .= "$_"; last; }
>     if($chars[$i-1] eq "\\") {
>         SWITCH: for ($chars[$i]) {
>             /t/ &&  do { $str .= "\t"; last SWITCH; };
>             /n/ &&  do { $str .= "\n"; last SWITCH; };
>             /r/ &&  do { $str .= "\r"; last SWITCH; };
>             /f/ &&  do { $str .= "\f"; last SWITCH; };
>             /b/ &&  do { $str .= "\b"; last SWITCH; };
>             /a/ &&  do { $str .= "\a"; last SWITCH; };
>             /./ &&  do { $str .= "$_"; last SWITCH; };
>         }
>     } else {
>         SWITCH: for ($chars[$i]) {
>             /u/ &&  do { $str .= $usr; last SWITCH; };
>             /d/ &&  do { $str .= $dom; last SWITCH; };
>             .
>             .
>             .
>             /./ &&  do {
>                         $str .= "\%$_";
>                     };
>         }
>     }
> }
> 
> The problem with this is that I cannot use this method to expand \0xx
> (octal value) escape sequences, because I cannot express every
> possible value as a literal for the perl preprocessor to expand for me
> (as I'm doing in the top there).
> 
> How can I take a string provided to me in a variable and expand all
> backslash-escaped character sequences as if I were the perl
> preprocessor?


my $fmt = "user: %u\ndomain:%d\n"; # example

$fmt =~ s/(\\(?:t|n|r|f|b|a|e|c[@-_]|[0-7]{1,3}|x[[:xdigit:]]{1,2}))/qq["$1"]/eeg;



John
-- 
use Perl;
program
fulfillment


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

Date: Tue, 24 Dec 2002 11:56:00 GMT
From: Bart Lateur <bart.lateur@pandora.be>
Subject: Re: re splitting up a file
Message-Id: <hphg0v0cmao8tfn1jhvmjv2dv9u0lpb425@4ax.com>

Geoff Cox wrote:

>Each poem was separated from the next by 3 line
>feeds and the title of each poem separated from the body of the poem
>by 2 line feeds.

>There must be many more elegant solutions ! Not clear how I could
>detect 3 line feeds and use the titles of the poems as the file names
>without using Word to put in the @@@ and the ~~~.

	$/ = "\n\n\n";
	while(<DATA>) {
	    s/(.*?)\n\n/~~~$1~~~\n/s;
	    chomp and $_ .= "\n\@\@\@\n";
	    print;
	}
	__DATA__	
	title1

	ahjshJS Jk
	hjkhS Jks
	hshJSJKsa
	

	title2
	
	hjhhjk
	djahdhajkda
	ahjdkadha


	title3
	
	jakdkajdkl
	dkjakdjkla
	djkadkla
	djkadl

Result:
	~~~title1~~~
	ahjshJS Jk
	hjkhS Jks
	hshJSJKsa
	@@@
	~~~title2~~~
	hjhhjk
	djahdhajkda
	ahjdkadha
	@@@
	~~~title3~~~
	jakdkajdkl
	dkjakdjkla
	djkadkla
	djkadl

>Then used the the code below to extract
>each poem and name each file with the title of the poem.

Eh... why two steps? Provided it's safe for all tiutles to be used as
file names:

	$/ = "\n\n\n";
	mkdir "poems", 0755;
	while(<DATA>) {
	    chomp;
	    if(/(.*?)\n\n/) {
	        if(open OUT, ">poems/$1.txt") {
	            print OUT;
	        } else {
	             warn "Can't write to poem file '$1': $!\n";
	        }
	    } else {
	        warn "This poems has no title:\n$_\n";
	    }
	}


>$split[$n] =~ s/[~{2}]/\n /g;

That is wrong. It'll remove "~", "{", "}" and "2"  characters and
replace them with a newline. Drop the square brackets.

-- 
	Bart.


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

Date: Tue, 24 Dec 2002 07:58:09 -0600
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: re splitting up a file
Message-Id: <slrnb0gpvh.hst.tadmc@magna.augustmail.com>


[ snipped all quoted text 'cause the top-posting was a mess.
  please learn how to properly quote followup postings.
]


Geoff Cox <geoff.cox@blueyonder.co.uk> wrote:

> could you please put into English what
> is happening at following points?! Have only done v simple pattern
> matching so far....
> 
> 
> $/ = "\n\n\n";


All of Perl's special variables are documented in:

   perldoc perlvar

$/ is the "input record separator". It determines how much stuff
each <INPUT> will return.

Your "records" end with 2 blank lines (3 consecutive newlines),
so you'll now get 1 poem per <INPUT>.


>  my $title = $1 if /^(.*?)\n\n/s;


Matches as little as possible, but still ending with a blank line
(2 consecutive newlines), copies the matched characters to $title.


>  if ($title =~ /^\s*$/) { 


Matches lines that contain only whitespace characters ("blank" lines).


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: 24 Dec 2002 05:53:26 -0800
From: mark.faine@msfc.nasa.gov (Mark)
Subject: Re: regular expression help
Message-Id: <789ce0b0.0212240553.739c0211@posting.google.com>

"Jodyman" <Jodyman@hotmail.com> wrote in message news:<YLRN9.3339$ka5.383005@newsread1.prod.itd.earthlink.net>...
> "Mark" <mfaine@knology.net> wrote in message
> news:329dd608.0212231225.383e4793@posting.google.com...
> > I admit I've never been good with regular expressions but this one I
> > imagine would challenge even a pro.  In order to comply with a new
> > security directive passwords must meet the following guidelines:
> >
> > eight characters exactly
> >
> > The eight characters will contain at least one character each from at
> > least three of the following sets of characters:
> >
> > At least one uppercase letter
> > At least one lowercase letters
> > At least one numbers
> > At least one special characters
> >
> > I've tried various times, but as I said this one is hard:
> >
> > My feeble attempts have gotten me this far:
> >
> > /([A-Z]|[a-z]|[0-9]|(\W)){3,8}/
> >
> > but this does not account for order and, well it doesn't accout for so
> > many things...
> >
> > that's why I'm here, I can work out the simple ones but for this one I
> > have to ask for help from the experts.  I know if I spent the next two
> > or three days working on this I might could get close or even figure
> > it out but time is not a luxury I have on this one and hey why
> > re-invent the wheel.
> 
> Do you want to validate passwords or generate passwords with this criteria?

Actually I can see a case for both.

-Mark


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

Date: 24 Dec 2002 05:39:03 -0800
From: gdsafford@hotmail.com (Greg)
Subject: Re: SOS: evaluate a string/function
Message-Id: <a8f367ed.0212240539.6d754463@posting.google.com>

jg10@duke.edu wrote in message news:<Pine.GSO.4.50.0212240211450.8678-100000@teer4.acpub.duke.edu>...
> Hi,
> 
> SOS!!!
> 
> I have a seemingly very simple problem, but I'm stuck!
> 
> Basically, I have a string: $str="sin(2)", and I wanted
> to evaluate this string to get a numerical answer.
> Please see simple code below.
> 
> Thanks a million if you could help!
> 
> Merry Xmas!
> 
> #################################
> #!/usr/bin/perl -w
> use strict;
> 
> # This is ok: sin(2) gets executed
> print "sin(2)=", sin(2),"\n";
> 
> # Trying to execute sin(2) through $str, does not work.
> my $str="sin(2)";
> print "sin(2) again = ",eval{$str},"\n";

I'm no expert, but I think that you might want 

print "sin(2) again = ",eval ($str) ,"\n";

That is, the expression form of eval.

FWIW

> 
> ####################################
> 
> Output:
> 
> sin(2)=0.909297426825682
> sin(2) again = sin(2)
> 
> First output is ok,
> But I want the second to be 0.909 too.


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

Date: 24 Dec 2002 10:30:47 -0800
From: schuckm@emigrant.com (Mac)
Subject: Re: Stat() function not working.  Kind of...
Message-Id: <3d9b1ac6.0212241030.59e93eef@posting.google.com>

Thank you "purl guru" that fixed the problem.  Tad go jump in a lake, dickhead.

schuckm@emigrant.com (Mac) wrote in message news:<3d9b1ac6.0212190841.64b1ca81@posting.google.com>...
> I'm trying to get all the files in a specific directory and, at this
> point, simply retrieving information about them using the stat
> function.  Problem is, most of the files have no information about
> them and are coming up blank.  I can't make any rhyme or reason as to
> why some files are actually coming up with information and most not. 
> I've looked at the files' rights, directories' rights, and they all
> appear the same.  My development environment is Microsoft (IIS) and
> production is a Unix box, but the same problem occurs on both.  Can
> anyone lend any insight whatsoever as to why this may be occuring. 
> Thanks in advance.  Here's the code:
> 
> 
> #!/usr/local/bin/perl5
> 
> print ("Content-Type:text/html\n\n");
> 
> opendir(DIRHANDLE, "test/") or die "couldn't open directory : $!" ;
> 
> while ( defined ($filename = readdir(DIRHANDLE))) {
> 	($TEST1) = (stat($filename)) [0];
> 	($TEST2) = (stat($filename)) [7];
> 	($TEST3) = (stat($filename)) [2];
> 	($TEST4) = (stat($filename)) [9];	
> 
>         print $filename." - ".$TEST1."<BR>";
>         print $filename." - ".$TEST2."<BR>";
>         print $filename." - ".$TEST3."<BR>";
>         print $filename." - ".$TEST4."<BR>";	
> 	
> }
> 	
> closedir(DIRHANDLE);


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

Date: 24 Dec 2002 16:43:50 GMT
From: bps103@hotmail.com
Subject: test
Message-Id: <aua2s6$q6r$1@news.gte.com>

This is the body of the article


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

Date: Tue, 24 Dec 2002 15:39:58 GMT
From: cp <cpryce@pryce.nospam.net>
Subject: Re: Using XML Simple to Define variables
Message-Id: <241220020945575906%cpryce@pryce.nospam.net>

In article <3c80bfeb.0212231353.5d162f4d@posting.google.com>, Tunez
<vmontuoro@request.com.au> wrote:

> I'm having a few problems defining variables from an XML file when the
> tags have no value in them, it returns the following error
> 
> "Use of uninitialized value in concatenation (.) or string at
> xml-read.pl line 34."

That is not an error, that is a warning. Errors stop execution.
Warnings produce output on STDERR to warn you of potential problems. 

> 
> This message makes perfect sense because the variable is not there,
> what should I do????

In the docs for XML::Simple there is an option for suppressempty. This
option defines how XML::simple deals with empty values. Setting it to
'' might do what you want. Or if you except unitialized values as
valid, turn the warning off as in: 

{ 
   no warnings "uninitialized"; 
   # code that produces warnings
}

-- 
cp

remove 'nospam' to reply


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

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.  

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


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