[22661] in Perl-Users-Digest
Perl-Users Digest, Issue: 4882 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Apr 24 00:05:59 2003
Date: Wed, 23 Apr 2003 21:05:09 -0700 (PDT)
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 Apr 2003 Volume: 10 Number: 4882
Today's topics:
Advice: Perl + XML - Native Perl module? (MegaZone)
Re: cant connect to remote database <rereidy@indra.com>
Distribute a perl script (Patrice)
Re: file upload not working anymore <mgjv@tradingpost.com.au>
Little help (Erik Dokic)
looking for graphing program <chris_12003@yahoo.com>
LWP::Simple "get" gets me one giant line. Want array! <SeeMessageBody@nospam.com>
Re: LWP::Simple "get" gets me one giant line. Want arr <uri@stemsystems.com>
Re: LWP::Simple "get" gets me one giant line. Want arr <mfield@ernie.botany.ubc.ca>
Re: Newbie asking: How do I start? <wksmith@optonline.net>
Parent & Child question: (Cao Tran)
parsing perl code (audit, summarize, trace) <ericw@nospam.ku.edu>
Re: POD help - please - first time with pod2html <jkeen@concentric.net>
Re: POD help - please - first time with pod2html <jozefn@bolt.sonic.net>
Re: Removal of newline characters <michael.p.broida@boeing.com>
Re: Removal of newline characters <REMOVEsdnCAPS@comcast.net>
Re: split and substitute ? (Cao Tran)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 24 Apr 2003 03:18:30 GMT
From: usenet@megazone.org (MegaZone)
Subject: Advice: Perl + XML - Native Perl module?
Message-Id: <megazone.1051154309@sidehack.sat.gweep.net>
The great thing about Perl is that there are a million ways to do
things - but this is sometimes overwhelming, or just plain confusing.
And that's where I am now.
In the porting work I'm doing I need to parse XML - take it as input,
get the values I need, etc, then I need to send back an XML formatted
reply. Something DOMish seems like the right choice, to be able to
select-by-node, etc. Though XML::Twig looks like it might be fine
too... I've been slogging through CPAN, the Perl & XML book,
Google... And all I've really managed to determine is that any of a
dozen different modules would probably do what I need, but not why any
one of them is the best choice.
I was looking at lib::XML, but that's an XS wrapper to C - performance
isn't an overriding concern, but portability is. If possible, I'd
like to use an XML module that is native Perl. (It looks like
XML::Twig is, right?) Ideally the code will end up portable across
UNIX/Linux and Windows platforms.
Anyway - I'm basically looking for recommendations. What have people
used and liked, especially modules that are native Perl?
Thanks.
-MZ, CISSP #3762, RHCE #806199299900541
--
<URL:mailto:megazone@megazone.org> Gweep, Discordian, Author, Engineer, me..
"A little nonsense now and then, is relished by the wisest men" 508-755-4098
<URL:http://www.megazone.org/> <URL:http://www.eyrie-productions.com/> Eris
------------------------------
Date: Wed, 23 Apr 2003 19:53:30 -0600
From: Ron Reidy <rereidy@indra.com>
Subject: Re: cant connect to remote database
Message-Id: <3EA7439A.40208@indra.com>
What does "i can't connect to the remote database ..." mean? What is
your Oracle error message?
--
Ron Reidy
Oracle DBA
a_wim wrote:
> hi everybody,
> im in big trouble, i hope there is anybody who can help me!
> i want to connect to a database which is installd on hpux system and i
> want to
> connect from a sun to this database. on both machins, perl is
> installed and the oci driver although. on the sun machine i had
> installed the DBI-modul and DBD-modul
> the test-skript which were included in the DBD-module-direction works
> fine.
> now my problem:
> i cant connect to the remote database on the hpux, with my own perl
> skript !!!!!
> what can i do? or which modul i need more?
>
> thanx for help
> bye
------------------------------
Date: 23 Apr 2003 20:02:17 -0700
From: google@ppatrice.ovh.org (Patrice)
Subject: Distribute a perl script
Message-Id: <da445f9c.0304231821.700700c1@posting.google.com>
I have done a perl script as a project for univeristy. I am now
looking for a way to distribute it to my examiners so they can easily
test it. By easly I mean without having anything to install. There's a
high probability they have a windows machine, but I'd like to provide
something for Linux as well.
My script is using two modules : XML::LibXML and XML::LibXSLT
I tried perlcc and pp to build linux executables. I succeed but a
friend of mine tried both on his machine, and they didn't run because
of an incompatible glibc. Anyway, for Linux I can assume there is a
perl interpreter installed and just provide the source. But what about
the modules ? Will it work if I also put the *.pm files along with my
script ?
I also tried perl2exe to make both linux and win32 executables. Worked
for Linux but crashed when I launch it. And it didn't compile for
win32 (there is a file missing : p2x56exe.lib).
Any experience or advice to share ?
Thanks in advance.
------------------------------
Date: Thu, 24 Apr 2003 03:04:10 GMT
From: Martien Verbruggen <mgjv@tradingpost.com.au>
Subject: Re: file upload not working anymore
Message-Id: <slrnbael1b.4f7.mgjv@verbruggen.comdyn.com.au>
On Wed, 23 Apr 2003 09:38:33 +0200,
Andy Meier <andy@mindpilot.ch> wrote:
> I did not modify the perl program at all. The Plesk hosting panel says that
> there is still plenty of disc space available. I'm also using the same
> program on different servers where it still works.
Do they use quota? Most likely they do.
Did they check whether you have room left in your allocation of that
disk (or at least the user that writes to that directory)?
Martien
--
|
Martien Verbruggen | Useful Statistic: 75% of the people make up
Trading Post Australia | 3/4 of the population.
|
------------------------------
Date: 23 Apr 2003 16:11:56 -0700
From: erik.dokic@volja.net (Erik Dokic)
Subject: Little help
Message-Id: <cdb02f34.0304231511.6aa162c4@posting.google.com>
I need a little help with a Perl script. On Linux SuSE 8.1 I'd like to
run a script which contains a line:
open(XS,"/usr/X11R6/bin/xscreensaver-command -watch|") or die;
The script is supposed to excecute commands when the screen saver
starts/ends. But the file "xscreensaver" or something similar doesn't
exist there or elsewhere. How should I modify this to make the script
run?
Thanks in advance!
------------------------------
Date: Wed, 23 Apr 2003 19:49:22 -0700
From: "Chris" <chris_12003@yahoo.com>
Subject: looking for graphing program
Message-Id: <vaekga867vgj9d@corp.supernews.com>
Does anyone know of any graphing scripts that I can use that'll take the
input from a text file and display a graph to the user. The graph can
either update automatically or through a crontab once a day. I'm trying to
create a bar chart with 2 values to plot and maybe 3 if thats possible.
Thanks,
Chris
------------------------------
Date: Wed, 23 Apr 2003 23:14:41 GMT
From: "John" <SeeMessageBody@nospam.com>
Subject: LWP::Simple "get" gets me one giant line. Want array!
Message-Id: <B7Fpa.38965$4P1.3546683@newsread2.prod.itd.earthlink.net>
# The hard part's done! (i.e., reading a web page), but this always prints
out "That page has 1 lines."
# I want the lines of a web page in an array so I can search for certain
strings.
# Any ideas?
use LWP::Simple;
@content = get("http://www.cpan.org/");
chomp @content; # Didn't help.
print "That page has ", scalar @content, " lines.\n";
print "@content";
------------------------------------------------
Feel free to mail me: workingstiff19
...and that's at hotmail.
------------------------------
Date: Wed, 23 Apr 2003 23:25:46 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: LWP::Simple "get" gets me one giant line. Want array!
Message-Id: <x7fzo8pzid.fsf@mail.sysarch.com>
>>>>> "J" == John <SeeMessageBody@nospam.com> writes:
J> # The hard part's done! (i.e., reading a web page), but this
J> always prints out "That page has 1 lines." # I want the lines of a
J> web page in an array so I can search for certain strings. # Any
J> ideas?
define line.
J> use LWP::Simple;
J> @content = get("http://www.cpan.org/");
J> chomp @content; # Didn't help.
J> print "That page has ", scalar @content, " lines.\n";
J> print "@content";
you are using a winblows box to post so i will guess you are also using
it for this get. and the default line endings there are CR/LF.
but i will wager that cpan.org is on a unix flavor. so it has line
endings of \n (LF).
so the split into lines will fail. the chomp was useless anyway as it
only sees one line.
try using split /\n/ to get multiple lines. and assign the get to a
scalar instead. the http doesn't have anything like ftp's line ending
conversion stuff since html doesn't need it.
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
------------------------------
Date: Wed, 23 Apr 2003 16:30:04 -0700
From: mfield <mfield@ernie.botany.ubc.ca>
Subject: Re: LWP::Simple "get" gets me one giant line. Want array!
Message-Id: <3EA721FC.BBC88639@ernie.botany.ubc.ca>
>
try:
my $content = get("http://www.cpan.org/");
my @newContent = split /^/, $content;
print "That page has ", scalar @newContent, " lines.\n";
exit;
------------------------------
Date: Thu, 24 Apr 2003 03:53:51 GMT
From: "Bill Smith" <wksmith@optonline.net>
Subject: Re: Newbie asking: How do I start?
Message-Id: <jdJpa.108242$MB4.37393264@news4.srv.hcvlny.cv.net>
"William Goedicke" <goedicke@goedsole.com> wrote in message
news:m38yu1gsnr.fsf@mail.goedsole.com...
> Dear G. -
>
> "GMK" <gkaraganis@nospam.spireholdings.com> writes:
>
> > I am interested in getting into Perl but do not know where to start
from.
>
> A very wise friend of mine was once asked "How do I become a perl
> programmer like you?". He responded "Well, a perl programmer is
> someone who writes perl programs; so go ahead and write some."
>
Your friend was wise indeed. I might add, "Revise them often to exploit
new skills."
> I would suggest that you install perl on your computer, get the
> O'Reilly "Learning Perl" book and start writing some code.
Use your books for learning concepts. Use on-line reference (type:
perldoc perldoc for help) whenever you need details that you can't
remember. With practice, this will become much faster than digging
through books and has the added advantage that all the info is
appropriate to the version of perl that you are using.
Have fun
Bill
------------------------------
Date: 23 Apr 2003 20:01:30 -0700
From: caotran@sbcglobal.net (Cao Tran)
Subject: Parent & Child question:
Message-Id: <d2256902.0304231815.109db89d@posting.google.com>
Hi,
Here is what I want to do:#! /usr/local/bin/perl
$None = $#ARGV + 1;
if ($None == "0"){
print "USAGE: schematic {PROGRAM_NAME}!\n";
exit;
}
$ARGV[0] =~ tr/a-z/A-Z/;
$project = $ARGV[0];
$HOME=$ENV{HOME};
Schematic();
sub Schematic{
$ENV{PATH}= "$HOME/tmp/schematics/";
open(LS,"ls *.ps|");
while(<LS>) {
tr/A-Z/a-z/;
($num) = /_[_]+(\w+)\.ps/ ;
$num = "$2" ."$1" if $num =~ /([a-z])(\d+)/ ;
rename($name, "$num.ps");
}
close (LS);
print $ENV{PATH};
}
When I run this script, I got this message:
sh: ls: not found
But when I change to sh, and type ls, it work?
Please help!
Thanks,
Cao Tran
------------------------------
Date: Thu, 24 Apr 2003 04:02:14 GMT
From: Eric Wilhelm <ericw@nospam.ku.edu>
Subject: parsing perl code (audit, summarize, trace)
Message-Id: <pan.2003.04.23.22.59.50.525691.13701@nospam.ku.edu>
Is there a module which allows you to parse perl code?
For example, I would like to write a program which prints all of the
variables from a list of perl sources (accounting for @array and
$array[0] only once).
Suggestions?
Thanks,
Eric
------------------------------
Date: 23 Apr 2003 22:09:54 GMT
From: "James E Keenan" <jkeen@concentric.net>
Subject: Re: POD help - please - first time with pod2html
Message-Id: <b872vi$r30@dispatch.concentric.net>
"Joseph Norris" <jozefn@bolt.sonic.net> wrote in message
news:Pine.LNX.4.40.0304231314540.19344-100000@bolt.sonic.net...
>
> I am trying to do a simple thing - I thought.
>
> I just want to include some perl code in my pod documentation.
> But when I do pod2html the resulting html file shows my perl code
> with no indentation and no breaks - just one continuous line.
>
> Can anybody give me a direction to take?
>
The browser will automatically flow body copy to fit the window, but you
must manually break lines of code yourself. If you limit each line to 74
characters/line, it will look good in IE with the text side set at
''larger'' (Alt-v,x,l).
Avoid hard tabs in your POD; use 2 to 4 whitespaces instead. Make sure you
have no lines that (other than the newline character) are just whitespace.
------------------------------
Date: Wed, 23 Apr 2003 23:49:03 GMT
From: Joseph Norris <jozefn@bolt.sonic.net>
Subject: Re: POD help - please - first time with pod2html
Message-Id: <Pine.LNX.4.40.0304231648370.13646-100000@bolt.sonic.net>
Thanks for your help on this problem.
This showed me what I needed.
#Joseph Norris (Perl - what else is there?/Linux/CGI/Mysql)
print @c=map chr $_+100,(6,17,15,16,-68,-3,10,11,16,4,1,14,-68,12,1,14,8,
-68,4,-3,-1,7,1,14,-68,-26,11,15,1,12,4,-68,-22,11,14,14,5,15,-90);
On Wed, 23 Apr 2003, Gunnar Hjalmarsson wrote:
> Joseph Norris wrote:
> > I just want to include some perl code in my pod documentation.
>
> <snip>
>
> > Can anybody give me a direction to take?
>
> I can: Follow the instructions in the Pod::Html docs.
>
> / Gunnar
>
> --
> Gunnar Hjalmarsson
> Email: http://www.gunnar.cc/cgi-bin/contact.pl
>
>
------------------------------
Date: Thu, 24 Apr 2003 00:07:05 GMT
From: "Michael P. Broida" <michael.p.broida@boeing.com>
Subject: Re: Removal of newline characters
Message-Id: <3EA72AA9.EF5CF8DB@boeing.com>
D'oh wrote:
>
> Stephen Adam wrote:
> >
> > $searchresult =~ s/\n/ /; # !! The bit that don't work!!
>
> replace with
>
> chomp($searchresult);
I was about to suggest that, but I re-read the
original message. It looks like he/she wants
to remove ALL the newlines (possibly more than
one) from a single scalar.
"chomp()" only removes ONE newline from the END
of the scalar IF there is one there.
Mike
------------------------------
Date: Wed, 23 Apr 2003 20:15:49 -0500
From: "Eric J. Roode" <REMOVEsdnCAPS@comcast.net>
Subject: Re: Removal of newline characters
Message-Id: <Xns9366D86435ECBsdn.comcast@216.166.71.239>
-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1
"Michael P. Broida" <michael.p.broida@boeing.com> wrote in
news:3EA72AA9.EF5CF8DB@boeing.com:
>
> "chomp()" only removes ONE newline from the END
> of the scalar IF there is one there.
and IF $/ is "\n".
- --
Eric
print scalar reverse sort qw p ekca lre reh
ts uJ p, $/.r, map $_.$", qw e p h tona e;
-----BEGIN xxx SIGNATURE-----
Version: GnuPG v1.2.1 (MingW32) - WinPT 0.5.13
iD8DBQE+pzrbY96i4h5M0egRAngCAJ4smNXTAz0C08k1ex+jixAIXODE6wCfdomT
HuImzwhXsJLMBy35rlmcjy4=
=M1rM
-----END PGP SIGNATURE-----
------------------------------
Date: 23 Apr 2003 15:25:56 -0700
From: caotran@sbcglobal.net (Cao Tran)
Subject: Re: split and substitute ?
Message-Id: <d2256902.0304231425.3c184665@posting.google.com>
"John W. Krahn" <krahnj@acm.org> wrote in message news:<3EA68F1C.101BD2A7@acm.org>...
> Cao Tran wrote:
> >
> > Here is my data from a hash key ($pages{$uhi}):
> >
> > :0001:0002:0003:0004:0005
> >
> > I want to split and put in an array
> >
> > @Page = split (/:/, $pages{$uhi});
> >
> > foreach (@Pages){print "\n"}
> >
> > Output in @Page:
> > 0001
> > 0002
> > 0003
> > 0004
> > 0005
> >
> > which work fine, but I have another database that has this kind of
> > data:
> >
> > 0001 0002 0003 0003A0004 0005
> >
> > I want to add to @Page and have output similiar to these:
> > 0001
> > 0002
> > 0003
> > 0003A
> > 0004
> > 0005
> >
> > How do I write code to cover both case? I don't know much of split
> > function, could someone help me with this. One other note: I can't
> > write to the database.
>
>
> @Page = $pages{$uhi} =~ /[[:alnum:]]{4,5}/g;
>
>
> John
I think I figure it out, but I hate to use it, because it's
inefficient. Here is my code, let see if you have any comments:
@Pages = split /([0-9A-Z]{4}|[0-9]{3})/, $pages{uhi};
@Pages = grep (/[0-9A-Z]{4}|[0-9]{3}/, @Pages);
sort(@Pages);
------------------------------
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 4882
***************************************