[16764] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4176 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Aug 30 11:05:27 2000

Date: Wed, 30 Aug 2000 08:05:10 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <967647910-v9-i4176@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Wed, 30 Aug 2000     Volume: 9 Number: 4176

Today's topics:
    Re: error displaying with Perl compilator daniele7029@my-deja.com
    Re: Executable file creating executable file -- doesn't joshfeingold@my-deja.com
    Re: Extra ^M in text file <lincolnmarr@nospam.europem01.nt.com>
    Re: file locking not working (Anno Siegel)
    Re: Finding a file in a huge filesystem <claytons@nortelnetworks.com>
    Re: Finding a file in a huge filesystem (Rafael Garcia-Suarez)
    Re: ftp function call in perl change the file size. <dperham@dperham.eng.tvol.net>
    Re: Getting the greedy RegEx, wanting the Lazy - help? <callgirl@la.znet.com>
    Re: help in newfeeds (Keith Calvert Ivey)
        interchanging variables <ankban4@indiainfo.com>
    Re: interchanging variables <Eike.Grote@consol.de>
        Jumping to the previous row with DBI <Hans.X.Eriksson@etx.ericsson.se>
    Re: Jumping to the previous row with DBI <hmerrill@my-deja.com>
        local *FILENAME within procedures....good practice? <bcaligari@my-deja.com>
    Re: MySQL Table (Jon S.)
    Re: MySQL with Perl <info@digitaltango.com>
    Re: Novice question: Interpolating embedded variables f <dperham@dperham.eng.tvol.net>
    Re: Parsing a Excell table - or - a "Tab New_Line" text <info@digitaltango.com>
    Re: Question about variable use lishy1950@my-deja.com
    Re: regex to match (and replace) a control code. (Keith Calvert Ivey)
    Re: Regexp help required <sariq@texas.net>
    Re: REQ is there a script .... <sven-s@hushmail.com>
        retrieve cookie from browser <danielxx@bart.nl>
    Re: retrieve cookie from browser <info@digitaltango.com>
        www.perl.com won't come in on my computer.... (Jon S.)
        XS: undefined symbol (Campbell)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Wed, 30 Aug 2000 13:24:46 GMT
From: daniele7029@my-deja.com
Subject: Re: error displaying with Perl compilator
Message-Id: <8oj1u8$8uf$1@nnrp1.deja.com>



Hi,
Merveillous for your quick answer but I try it and it dos not works.
Waiting some more informations...

In article <8oir43$qpe$1@bvweb.iona.com>,
  "Graham Wood" <graham.wood@iona.com> wrote:
> try perl my_program.txt > error.txt 2>&1
>
> This works on NT.  The 2>&1 is telling the operating system to send
the
> STDERR to the same place as the STDOUT.
>
> Graham Wood
>
> <daniele7029@my-deja.com> wrote in message
> news:8oih25$mas$1@nnrp1.deja.com...
> > Hi,
> >
> > I m newly Perl programmer and I had downloaded ActivePerl.
> > When I running compilator into Dos session (I have also window 98)
> > lot of errors appears, as commun, but I can t cath the beginning
> > of errors.
> > I fact I d like to know how to send errors into a file like
error.txt.
> > I try use perl my_program.txt | more or perl my_program.txt >
error.txt
> > or use STDERR=error.txt but I doesn t work...
> >
> > I will very happy of your help.
> >
> > Thanks a lot.
> >
> > Daniele
> >
> >
> >
> > Sent via Deja.com http://www.deja.com/
> > Before you buy.
>
>


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Wed, 30 Aug 2000 13:17:37 GMT
From: joshfeingold@my-deja.com
Subject: Re: Executable file creating executable file -- doesn't work
Message-Id: <8oj1gu$8ao$1@nnrp1.deja.com>

Thanks for the answers.  In the end, I did a chmod in the script which
changed the permissions while it was still part of the staff group.

Josh

In article <8oeb4n$pdd$1@nnrp1.deja.com>,
  joshfeingold@my-deja.com wrote:
> Here is my scenario:
>
> I have a file "parent.pl" which creates a file "child.pl". The problem
> is that when parent.pl is run and creats child.pl via the Internet the
> file is put in the Unix group "staff" which is not executable by me.
> How can I make a file which can be executed and have permissions
> changed by me?
>
> Thanks,
> Josh
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Wed, 30 Aug 2000 15:21:11 +0200
From: "Lincoln Marr" <lincolnmarr@nospam.europem01.nt.com>
Subject: Re: Extra ^M in text file
Message-Id: <8oj1nq$q7u$1@qnsgh006.europe.nortel.com>


> I am working with Perl/NT. Every time I create a text file from my
> program, I find a ^M at the end of each line of the file.
>
> Does anyone know why this is happening?
>

See my other post about this... I still haven't solved it but the ^M is a
control character (on my UNIX box it's ascii no. \015) which is code for a
carriage return... to get rid of it I wrote a routine to substitute globally
\015 with nothing. There may be another way out of this, I'm not sure yet as
I'm still working on it but if I find out i'll let you know.

Another point worth mentioning is that if you are ftp'ing/transferring files
from a UNIX/Linux system to windows then the ^M won't appear if you transfer
in ascii mode instead of binary... but maybe this is too off-topic and
better discussed in another forum (maybe comp.unix.questions)




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

Date: 30 Aug 2000 14:50:32 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: file locking not working
Message-Id: <8oj6vo$itf$1@lublin.zrz.tu-berlin.de>

Lincoln Marr <lincolnmarr@nospam.europem01.nt.com> wrote in comp.lang.perl.misc:
>
>>
>> I think you might bump into the same problem that many people bump into
>> when using flock. Locking a file with flock HANDLE, LOCK_EX only prevent
>> _cooperating_ programs from getting read or write access to it. In other
>> words, only programs that use flock will be stopped from opening the
>> file. If you have 50 programs that lock and unlock a file, and one that
>> doesn't, your data is not safe, and not guaranteed to be consistent.
>> This is called an advisory locking scheme.
>
>Does Perl have any command which makes it take notice of the file lock??  I

Why, yes.  It's called flock.

>don't want 2 or more people running my script to be able to write to the
>same file simultaneously, because of the risk of data corruption - meaning
>that junk is outputted to the browser.
>
>The only thing that will be accessing the files is the script - so it's the
>only thing that I want to take notice of the file lock... but I'm not sure
>how. Suggestions anyone?

That's the whole point about the flock mechanism.  flock( LOCK_EX) and
flock( LOCK_SH) will return only when it is safe for a process to
access the file in the indicated manner[1].  It's all you need to make
your program take notice of locks.  The problem are processes that
don't use flock accessing the same file(s).

Anno


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

Date: Wed, 30 Aug 2000 09:05:18 -0400
From: Clayton Scott <claytons@nortelnetworks.com>
Subject: Re: Finding a file in a huge filesystem
Message-Id: <39AD068E.38C3E9DB@nortelnetworks.com>

nkhan75@hotmail.com wrote:
> 
> Hello,
> 
> My problem is as follows:
> 
> I need to find a file, say foo.txt, in a file tree that contains
> several thousand files. Just traversing through the tree takes over 2
> hours on a strong machine. Hence I need to come up with Perl code
> which, as soon as it finds the file, stops the search. Ofcourse, if the
> file does not exist the code will step through all the files in the
> tree looking for foo.txt.
> 
> Can anyone please guide me (a novice at Perl)?

	Read the perl documentation for the File::Find module (include
 as a part of the standard distribution)

 'perldoc File::Find' on your command line

Clayton


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

Date: Wed, 30 Aug 2000 14:34:26 GMT
From: rgarciasuarez@free.fr (Rafael Garcia-Suarez)
Subject: Re: Finding a file in a huge filesystem
Message-Id: <slrn8qq70h.98n.rgarciasuarez@rafael.kazibao.net>

nkhan75@hotmail.com wrote in comp.lang.perl.misc:
>Hello,
>
>My problem is as follows:
>
>I need to find a file, say foo.txt, in a file tree that contains
>several thousand files. Just traversing through the tree takes over 2
>hours on a strong machine. Hence I need to come up with Perl code
>which, as soon as it finds the file, stops the search. Ofcourse, if the
>file does not exist the code will step through all the files in the
>tree looking for foo.txt.

Besides using Perl, if you have performance problems, you might be
interested by GNU locate, part of the findutils package:
  http://www.gnu.org/manual/findutils/
(I don't know if there are Windows versions available).

-- 
Rafael Garcia-Suarez


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

Date: 30 Aug 2000 10:39:14 -0400
From: Doug Perham <dperham@dperham.eng.tvol.net>
Subject: Re: ftp function call in perl change the file size.
Message-Id: <8166oiu831.fsf@wgate.com>


calvin <calvin@pixelmetrix.com> writes:

> Hi all,
> 
> When I used the "ftp.pl" in my source code to ftp and get some target
> file, I found the file size I got would be changed. What happened? And
> How to fix the problem?
> 
> Thank you.
> 
> Rgds,
> Calvin

you probably sent a binary file in ascii mode

try

use strict;
use Net::FTP;

my $ftp=  Net::FTP->new("some.host.name", Debug => 0);
$ftp->login("anonymous",'me@here.there');

# -- !!!!!!!!!!!!! --
$ftp-binary;

$ftp->get("that.file");

$ftp->quit;

-- 
Doug Perham                                          o{..}o     
dperham@wgate.com                                moo! (oo)___   
WorldGate Communications, Inc.                        (______)\ 
                                                      / \  / \  


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

Date: Wed, 30 Aug 2000 07:49:28 -0700
From: "Godzilla!" <callgirl@la.znet.com>
Subject: Re: Getting the greedy RegEx, wanting the Lazy - help?
Message-Id: <39AD1EF8.7AAF50D4@la.znet.com>

ptomsic@my-deja.com wrote:
 
>   daniel@chetlin.com wrote:

> > If you post a better spec of exactly what you're trying to do, 
> > I'll be happy to try to show you how.

> You're requesting a better spec of what I'm trying to do..
 
> Whatever is in-between, is exactly what I need, but those markers are
> not consistent across each file, as they were done by a few temps' from
> agencies, so sometimes there's a few BEGIN lines
> and sometimes there's a few END lines.  And obviously, there's no
> consistencies for the markers that I'm looking for, but they're NEARLY
> what I've typed above.  Sometimes they've got
> "less than, bang, three hyphens, lowercase begin, five spaces, upper-
> case STUFF, one space, two hyphens, greater than"  and other times it
> could be slightly different.



"...done by a few temps' from agencies...."

* laughs * How totally lame. Amazingly, most of these
fools around here actually buy into your mule manure.


"...Sometimes they've got "less than, bang, three hyphens, 
 lowercase begin, five spaces, upper- case STUFF, one space,
 two hyphens, greater than"  and other times it could be 
 slightly different...."

What the F-word is this idiotic mule manure? Planning on
changing your parameters again if someone provides a 
decent reasonable answer?



What is your problem you cannot post your actual parameters
right from the get-go? It is exceptionally annoying to have
you post a question only later to change your parameters and
argue about a solution. This behavior of yours is such an 
intellectually impotent mindgame, it is suitable only for a
sociopathic misfit of questionable intellect. More annoying
is how many here sucker into your childish games, regardless
of these fake names you employ to play this idiot's game,
over and over.

Your original sample html is missing a space for "a href"
which is inexcusable, even as an example. Why are you using
pragma hints, warnings and strict, along with file open and
file close error checks for a simple six line test script? 

Use of 'join' in place of  $/ = "" along with your notion
you can parse html with a regex, indicates you are lacking
in prerequisite knowledge of Perl to be qualified to
write Perl scripts.

If you cannot write a simple short test script without a need
for pragma hints and error checking, if you cannot debug a 
script as simple as you show without perl core help, if you
cannot employ effective programming logic, you need to study 
Perl for a year or better before trying to write any script.

Both you and your articles are full of mule manure.


Godzilla!

-- 
Perl Monger's Perfect Perl Perl Land.
  http://la.znet.com/~callgirl/perlperl.cgi


TEST SCRIPT:
____________


#!/usr/local/bin/perl

print "Content-Type: text/plain\n\n";

$/ = "";
open (TEST, "test.txt");
$string = <TEST>;
close (TEST);

print "Input:\n\n$string\n\n";

$string =~ s¡ \n|\n ¡ ¡g;
$string =~ s¡(<.*)\n(.*>)¡$1$2¡g;
$string =~ s¡\n¡ ¡g;
$string =~ s¡STUFF-¡stuff-¡i;
$string =~ s¡-STOP¡-stop¡i;

$start = index ($string, "stuff--->");
$start = $start + 9;
$stop = index ($string, "<!--stop");

$new = substr ($string, $start, $stop - $start);

print "Output:\n\n$new";

exit;


PRINTED RESULTS:
________________

Input:

<TD><testing="one">FIRST</testing></TD><test ing="two">SECOND </test
ing></TD>MORE<TD><b>b </b><a href="one.html">This</a>-<!-BEGIN-><a 
href="two.html
">that</a> the other<!-END->boing<TD><font>font</font><!---BEGIN STUFF--
->HEre
is a
little TEST
<!--END CONTENT HERE--->
<!--STOP STUFFxxx---------->bingo
bango
testingonetweetergoods



Output:

HEre is a little TEST <!--END CONTENT HERE--->


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

Date: Wed, 30 Aug 2000 13:33:59 GMT
From: kcivey@cpcug.org (Keith Calvert Ivey)
Subject: Re: help in newfeeds
Message-Id: <39bc0c96.49830308@news.newsguy.com>

"Mo Jiazhou" <isc80031@nus.edu.sg> wrote:

>hi, people, how do i draw news feed from another content site by perl?
>any one is familiar with this? where can i find some sample code? or where
>can i know more about it?

You already asked this question and got answers.  Perhaps they
weren't useful because people don't know what you mean when you
say "news feed".  Most of us probably think about a source of
Usenet messages when we hear that term, but your original post
mentioned newspapers, so you're probably not referring to
Usenet.

Asking the question repeatedly likely won't result in better
answers.  Being more specific about what you're looking for
might.

-- 
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC


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

Date: Wed, 30 Aug 2000 13:40:27 GMT
From: Ankur Banerjee <ankban4@indiainfo.com>
Subject: interchanging variables
Message-Id: <8oj2s6$9ss$1@nnrp1.deja.com>

HI,
How do i interchange values of three variables $a,$b,$c WITHOUT  using
this expression:-
($a,$b,$c)=($b,$c,$a);

I have thought of this:-
$a=$a+$b+$c;
$c=$a-($b+$c);
$b=$a-($b+$c);
$a=$a-($b+$c);

Any other ways to do it ??
Thanks
Ankur


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Wed, 30 Aug 2000 16:08:53 +0200
From: Eike Grote <Eike.Grote@consol.de>
Subject: Re: interchanging variables
Message-Id: <39AD1575.557A8CF8@consol.de>

Hi,

Ankur Banerjee wrote:
> 
> HI,
> How do i interchange values of three variables $a,$b,$c WITHOUT  using
> this expression:-
> ($a,$b,$c)=($b,$c,$a);
> 
> I have thought of this:-
> $a=$a+$b+$c;
> $c=$a-($b+$c);
> $b=$a-($b+$c);
> $a=$a-($b+$c);

This will definitely cause problems if your variables contain
text, and may be troublesome if you use (floting point) numbers.

Better is

{ my $t=$a; $a=$b; $b=$c; $c=$t  }


Bye, Eike


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

Date: Wed, 30 Aug 2000 15:11:52 +0200
From: Hans Eriksson <Hans.X.Eriksson@etx.ericsson.se>
Subject: Jumping to the previous row with DBI
Message-Id: <39AD0818.669A029C@etx.ericsson.se>

Hello!

Does anyone know if it is possible to go to the prevoius row when using
the Perl DBI interface? I.e. -- Is it possible to "go back" when a
$sth->fetchrow has been issued?


Regards

/Hans


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

Date: Wed, 30 Aug 2000 14:24:45 GMT
From: Hardy Merrill <hmerrill@my-deja.com>
Subject: Re: Jumping to the previous row with DBI
Message-Id: <8oj5ek$dcv$1@nnrp1.deja.com>

In article <39AD0818.669A029C@etx.ericsson.se>,
  Hans.X.Eriksson@etx.ericsson.se wrote:
> Hello!
>
> Does anyone know if it is possible to go to the prevoius row when
using
> the Perl DBI interface? I.e. -- Is it possible to "go back" when a
> $sth->fetchrow has been issued?

This topic should be moved to the DBI Users mailing list
(dbi-users@isc.org).

I checked the "Programming the Perl DBI" book since I'm not aware of any
way to access the previous row - I couldn't find anything in the book
about that either.  I don't think it's possible with a DBI method.

Hardy Merrill
Mission Critical Linux, Inc.
http://www.missioncriticallinux.com


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Wed, 30 Aug 2000 14:38:39 GMT
From: Brendon Caligari <bcaligari@my-deja.com>
Subject: local *FILENAME within procedures....good practice?
Message-Id: <8oj69b$eaj$1@nnrp1.deja.com>

Is it a good practice to 'localise' a filename prior to use
within 'sub' procedures?

To avoid name conflicts I am adopting the following policy,
in case the 'calling function' has opened a file with the
same name.

eg:

sub logEvent {
  my $fname = shift();
  local *LOGFILE;
  unless ((-e $fname) && (open(LOGFILE, ">>$fname"))  {
  .
  .


am I getting it all wrong or am i on the right track??

I am enjoying the 'easy goingness' of perl, but at times I'm being
driven up the 'Wall' (pun not intended).

Brendon
++++


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Wed, 30 Aug 2000 14:50:39 GMT
From: jonceramic@nospammiesno.earthlink.net (Jon S.)
Subject: Re: MySQL Table
Message-Id: <39ad1e8a.6074395@news.earthlink.net>

On Wed, 30 Aug 2000 12:53:33 +0200, Marvin <ales.romaniuk@zag.si>
wrote:

>In article <8oima3$l26$1@uns-a.ucl.ac.uk>, a.peacock@chime.ucl.ac.uk 
>says...
>> In article <MPG.1416cae8686f972d989682@news.siol.net>, ales.romaniuk@zag.si 
>> says...
>> >
>> >Hi !
>> >
>> >Can anyone tell me, how to obtain information about table into Perl.
>> >I would like to know field name, field type, size, is it key etc..
>> 
>> RTFM:
>> 
>> http://www.mysql.com/documentation/mysql/mysql/commented/manual.php?section=SHO
>> W
>> 
>> Issue this command using the usual DBI/DBD interface.
>> 
>> 
>I am using DBI/DBD interface all the time, I just haven't had any need 
>for obtaining field specifications till now. And in Perl DBI book I 
>didnt find anything usable.

The mysql.com docs are your friend.  Very useful and, although
sometimes scattered, everything is in there.  You can do what you want
(and more) from a telnet command line and see and modify anything you
want to, without having to code it.

Those along with Aligators' book give you just about everything.
Also, look in the appendix for specific MySQL commands and specs.

Again, this isn't a good forum for this question.  I recommend
subscribing to the MySQL modules list.  The author of the module hangs
out there, and it's low traffic because it's not listed on the
mysql.com page properly.  You have to drill down to searching the
archives of the listservs, and you'll find the list for it.

Best of Luck,

Jon


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

Date: Wed, 30 Aug 2000 14:48:38 GMT
From: "Etienne Laverdiere" <info@digitaltango.com>
Subject: Re: MySQL with Perl
Message-Id: <a99r5.3163$O5.129789@news20.bellglobal.com>

You can create tables in your database using a simple SQL statement (CREATE
TABLE...) directly on your keyboard or with a perl DBI script.

Etienne.



<notknown@anonymous.com> wrote in message
news:39AC93FD.8D7FBF43@anonymous.com...
> i really need a simple script or some code bits that would help me to
> create a MySQL database.
>
> thanks in advance
>




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

Date: 30 Aug 2000 10:32:52 -0400
From: Doug Perham <dperham@dperham.eng.tvol.net>
Subject: Re: Novice question: Interpolating embedded variables from a template file
Message-Id: <818zteu8dn.fsf@wgate.com>

"Toni" <trioinfoQUITAESTO@trioinfografia.com> writes:

> Hello!
> 
> I've a template html file where I've embedded scalar vars in this way:
> 
> ...
> <TD> Today is $date </TD>
> ...
> 
> I want to generate files with this embedded vars interpolated to the value
> calculated in the script, using something like this :
> 
> foreach $_ (<TEMPLATE>){
>   print OUTPUT_FILE $_;
> }
> 
> I hope I've been explained OK, my english is not enough good
> Can anybody help me?
> 
> THANKS
> 
> 
> (Sorry for the cross-posting to comp.lang.perl)

visit CPAN and check out Text::Template

-- 
Doug Perham                                          o{..}o     
dperham@wgate.com                                moo! (oo)___   
WorldGate Communications, Inc.                        (______)\ 
                                                      / \  / \  


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

Date: Wed, 30 Aug 2000 14:31:09 GMT
From: "Etienne Laverdiere" <info@digitaltango.com>
Subject: Re: Parsing a Excell table - or - a "Tab New_Line" text file?
Message-Id: <NU8r5.3157$O5.129101@news20.bellglobal.com>

Thanks for your answer.
This was hat I need.
I finaly made it working !! It is very suprising to see tha running.

But I have notice that my parsing cannot read a field containing more than
255 characters.
I have a "description" field that usualy contain more than 255 characters.
Where could I set the "retreiving field type"?
I would need to set something like "textsize=10000", or VarChar(10000) or
"memo"... when I am reading my Excel table.

I know that I can specify the DataType in a Bind Value
(Mastering DBI, p.124 : $sth->bind_param(3, 123, {TYPE+> SQL_VARCHAR});)

VBy default, everything seems to be a VarChar in DBI. I don't know where to
specify my Select values.

Best Regards,

Etienne Laverdiere
Montreal


"Bob Walton" <bwalton@rochester.rr.com> wrote in message
news:39AB387C.8AD69D47@rochester.rr.com...
> Etienne Laverdiere wrote:
> ...
> > I have tried your solution, but I still have some problem with the
> > response. I have this error :
> >
> > Software error:
> > Describe failed during DBI::st=HASH(0x8bbf0dc)->FETCH(NAME) at
> > D:\xitami\cgi-bin\ex1\excel.pl line 46.
> >
> > here's the code I used:
> > use DBI;
> > use Data::Dumper;
> > my $drv  = 'ODBC:driver=Microsoft Excel Driver (*.xls)';
> > my $dir  = 'd:/data/base_prod.xls'; #an Excel file
> > my $table = 'table1'; #a range name
> > my $dbh  = DBI->connect( "dbi:$drv;Dbq=$dir",,,{RaiseError=>1} ) or die
> > $DBI::errstr;
> > my $sth  = $dbh->prepare("select * from $table");
> >
> > error ----> $names=$sth->{NAME};
> > print $names;
> > for (@$names){print "field:$_\n"}
> > my $ref  = $sth->selectall_arrayref($sth);
> > print Dumper($ref);
> >
> > So, I named my first row of my Excel table "NAME", but it d'dn't help.
> > It seems that sth contain nothing.
> ...
> > Etienne Laverdiere
> ...
>
> I note that I get the same error you got if I specify a range name that
> doesn't exist in the workbook.  To specify a range name in Excel,
> highlight the range you want, and click on insert..name..define, type
> the name of the range in the blank and click the Add button.  Your
> ranges will show up in the listbox immediately above the top left cell
> of the spreadsheet.
>
> I also note that one can instead specify a worksheet as follows:
>
>     my $table='[Sheet1$]';
>
> to replace
>
>     my $table='table1';
>
> The square brackets and the $ are required, and "Sheet1" must be the
> name of a sheet in the workbook.  Theoretically, one can also specify a
> range like B1:D3 after the $, but I can't get that to work (Excel 8.0
> SR2, Windoze 98 SE).
>
> Also, note that the
>
>     $names=$sth->{NAME};
>     for(@$names){print "field:$_\n"}
>
> bit is just there to print out the field names DBI thinks the "database"
> has.  But if that bombs out, so will the later stuff (with a different
> error message).
> --
> Bob Walton




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

Date: Wed, 30 Aug 2000 13:38:49 GMT
From: lishy1950@my-deja.com
Subject: Re: Question about variable use
Message-Id: <8oj2p6$9qh$1@nnrp1.deja.com>

In article <8oh8r8$akfq2$8@ID-24002.news.cis.dfn.de>,
  news@tinita.de wrote:
> hi,
> lishy1950@my-deja.com wrote:
> > I'm trying to set an array of a list of file names in a directory.
What
> > I have currently is something like this:
>
> >  @FILELIST=(`ls /dir/subdir/subdir/filename.txt.*`);
>
> > It's not working.  Should it be brackets instead of () ?
>
> what does "it's not working" mean?
> does the script compile?
> does the command die with an error message?
> does @FILELIST contain anything?
>
> anyway, i'd recommend using opendir:
> perldoc -f opendir
> that's much more portable and robust.
>
> tina
>
> --

I meant that this array didn't pick up the file names I wanted it to.
The script ran without errors.  I will try readdir or opendir based on
the feedback.

Thanks!


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Wed, 30 Aug 2000 13:28:38 GMT
From: kcivey@cpcug.org (Keith Calvert Ivey)
Subject: Re: regex to match (and replace) a control code.
Message-Id: <39bb0a5a.49258098@news.newsguy.com>

<danny@lennon.postino.com> wrote:

>I am having trouble generating a regex to find an unknown control code.
>I have somehow got a control code embedded into some data, but am not
>sure what the code is, or how to match & replace it.If I do a cut and
>paste of the control code into my s/\code/ /g it works, but I would 
>like something a little more generic.

First you say you're having trouble generating a regex, but then
you say you created one by copying and pasting.  What exactly do
you want that different from what you have?

If you want to know what the control code is, you could copy and
paste the code into

    print unpack('H*', "[paste code here]"), "\n";

to see the hex value, or

    print ord("[paste code here]"), "\n";

if you prefer decimal values.

If you want to match multiple control codes, you'll need to
figure out which ones you want and use a character class or a
range in tr///, depending on what you're doing.  For example,

    tr/\x00-\x1F/ /;

will replace characters less than "\x20" (space) with spaces.

-- 
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC


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

Date: Wed, 30 Aug 2000 09:38:35 -0500
From: Tom Briles <sariq@texas.net>
Subject: Re: Regexp help required
Message-Id: <39AD1C6B.35C71ED0@texas.net>

Larry Rosler wrote:
> 
> In article <8ohj2f$nrd$18$1@news.t-online.com> on Wed, 30 Aug 2000
> 02:02:18 +0100, Dietmar Staab <dietmar.staab@t-online.de> says...
> > In article <8ohf97$g0u$1@nnrp1.deja.com>, marty_t@my-deja.com wrote:
> > > Thanks for this, but can anyone tell me how to write regular expressions
> > > please.
> >
> > perls documentation is your source
> >
> > perldoc perlre
> >
> > give's all you need to write regular expressions. ;-)
> 
> I hope the smiley is because you realize how bad that advice is.  It is
> truly sadistic to suggest that one learn about regular expressions from
> perlre, which is a reference manual, not a tutorial.
> 
> There are excellent Perl tutorials on the Web that include regular
> expressions.
> 
> The best source is the book 'Mastering Regular Expressions' by Friedl,
> which doesn't cover the latest Perl enhancements (see perlre for that),
> but is nevertheless quite helpful.

Jeffrey Friedl is working on the 2nd edition now (as evidenced by the
number of bugs he's found...see p5p).  I don't know if Jeffrey and ORA
are anywhere near to coming up with a proposed publishing date, though.

- Tom


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

Date: Wed, 30 Aug 2000 14:27:20 GMT
From: Sven <sven-s@hushmail.com>
Subject: Re: REQ is there a script ....
Message-Id: <gq5qqsc2b4pgusjcqkqvab2mvdf7ssjv8h@4ax.com>


This was a REAL beginners question - I know!

Anyway, thanks a lot for your replys guys!

Regards,
Sven   :-)


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

Date: Wed, 30 Aug 2000 14:19:46 GMT
From: "Daniel van den Oord" <danielxx@bart.nl>
Subject: retrieve cookie from browser
Message-Id: <6K8r5.84$bt4.2028@Typhoon.bART.nl>

I made a cookies with this ( in the domain 'directorie'
http://195.38.226.149/cgi-bin/login.cgi)

----------------------------------------------------------------------------
------
use CGI::cookie;
my ($c)
$c = new CGI::Cookie(-name    =>  'firescape',
                                    -value   =>  [Daniel,haha,nope,yes],
                                    -expires =>  '+12M'
                      );
print header(-cookie=>$c);
----------------------------------------------------------------------------
------

It creates the Cookie perfectly... the problem is how to retrieve it outside
that cgi-bin directorie !!!!
http://195.38.226.149/index.cgi uses this code to 'fetch the values...

----------------------------------------------------------------------------
------
%cookies = fetch CGI::Cookie;
@id = $cookies{'firescape'}->value;
----------------------------------------------------------------------------
------

It gives this error

----------------------------------------------------------------------------
------
Can't call method "value" on an undefined value at
C:\InetPub\wwwroot\index.cgi line 26.
----------------------------------------------------------------------------
------




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

Date: Wed, 30 Aug 2000 14:34:46 GMT
From: "Etienne Laverdiere" <info@digitaltango.com>
Subject: Re: retrieve cookie from browser
Message-Id: <aY8r5.3158$O5.128708@news20.bellglobal.com>

Hi


A cookie cannot be view outside outside the web's folder that create it.
Unless you set the path parameter to '/'.
For more detail look at the 'Cookie Section' in Javascript 1.2 from Oreilly,
or any tutorial about creating cookies in Javascript.

__________________________________________
Etienne Laverdière
etienne.laverdiere@bellactimedia.com
Développeur - Intégrateur WEB
Bell ActiMedia - E-Commerce
T: (514) 392.0112 #239
F: (514) 392-0052

http://webcommerce.bellactimedia.com



"Daniel van den Oord" <danielxx@bart.nl> wrote in message
news:6K8r5.84$bt4.2028@Typhoon.bART.nl...
> I made a cookies with this ( in the domain 'directorie'
> http://195.38.226.149/cgi-bin/login.cgi)
>
> --------------------------------------------------------------------------
--
> ------
> use CGI::cookie;
> my ($c)
> $c = new CGI::Cookie(-name    =>  'firescape',
>                                     -value   =>  [Daniel,haha,nope,yes],
>                                     -expires =>  '+12M'
>                       );
> print header(-cookie=>$c);
> --------------------------------------------------------------------------
--
> ------
>
> It creates the Cookie perfectly... the problem is how to retrieve it
outside
> that cgi-bin directorie !!!!
> http://195.38.226.149/index.cgi uses this code to 'fetch the values...
>
> --------------------------------------------------------------------------
--
> ------
> %cookies = fetch CGI::Cookie;
> @id = $cookies{'firescape'}->value;
> --------------------------------------------------------------------------
--
> ------
>
> It gives this error
>
> --------------------------------------------------------------------------
--
> ------
> Can't call method "value" on an undefined value at
> C:\InetPub\wwwroot\index.cgi line 26.
> --------------------------------------------------------------------------
--
> ------
>
>




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

Date: Wed, 30 Aug 2000 14:34:18 GMT
From: jonceramic@nospammiesno.earthlink.net (Jon S.)
Subject: www.perl.com won't come in on my computer....
Message-Id: <39ad1a52.4994847@news.earthlink.net>

Hi,

This isn't a language question per se, but it applies...

I have a weird problem that I'm not sure of the source.  It could be
my DSL's problem or my Mac's problem.  For some reason, when I'm
working on my Mac in MacOS, I can't get www.perl.com to come up in
either Netscape or Internet Explorer.  I'm on SWBell's DSL (evil
bastards) and MacOS8.1 (no flames please).  

It gets stuck looking for a /pub directory (if you can believe the
status messages on the bottom of the screen).

I have no problems on any other platform that I use, or with any other
site (like CPAN, which often has links to files in the perl.com
hierarchy, which also don't work)

Any hints?  Or a reliable mirror of www.perl.com that I can go to?

TIA,

Jon


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

Date: 30 Aug 2000 13:11:03 GMT
From: cb921@cb921.org (Campbell)
Subject: XS: undefined symbol
Message-Id: <slrn8qq8vf.ol1.cb921@cb921.org>

Hello, again...

I'm still trying to get over some functions from libraries, with headers
in C to work from.

I've quelched almost all the errors, getting the XS to parse and compile up.
On using one of the libs I have already finished with, and I am recieving
the following error

perl: error in loading shared libraries: /usr/lib/perl/blabla/Dxxxlib.so:
undefined symbol: dx_open

Dxxxlib was the name of the header, and I know my naming lacks a lot. :)

the function I am trying to call is dx_open.

My test program is simple, it calls only the dx_open and dx_close functions.

I am not sure what informations could be necassary, as I am not sure where
this problem is coming from, at all.

I am using Redhat-6.2 (The drivers 'require'), and perl 5 patchlevel 5
subversion 3.

Has anyone else experienced this problem?  Am I doing something stupid?  If
I need to provide any more information, please tell me what!

Thank you...

Campbell

-- 



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

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

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 V9 Issue 4176
**************************************


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