[22719] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4940 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon May 5 18:16:01 2003

Date: Mon, 5 May 2003 15:15:15 -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           Mon, 5 May 2003     Volume: 10 Number: 4940

Today's topics:
        What can i do now for learnling perl? (kevin)
    Re: What can i do now for learnling perl? <goedicke@goedsole.com>
    Re: What can i do now for learnling perl? <kasp@epatra.com>
    Re: What can i do now for learnling perl? <abuse@mweb.co.za>
    Re: What can i do now for learnling perl? <abigail@abigail.nl>
    Re: What can i do now for learnling perl? <News@LearnQuick.Com>
    Re: Why is POE idle most of the time? <goldbb2@earthlink.net>
    Re: writing in a new file <samj@austarmetro.com.au>
    Re: writing in a new file (Sam Holden)
    Re: writing in a new file <samj@austarmetro.com.au>
    Re: writing in a new file (Sam Holden)
    Re: writing in a new file <samj@austarmetro.com.au>
        XML::DOM parsing error (Robert Shaffer)
        XO host can't use CHMOD (tcnolan)
    Re: XO host can't use CHMOD <kasp@epatra.com>
    Re: XO host can't use CHMOD <abigail@abigail.nl>
    Re: XO host can't use CHMOD (tcnolan)
    Re: XO host can't use CHMOD <mbudash@sonic.net>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 5 May 2003 08:55:04 -0700
From: jl.cd@163.com (kevin)
Subject: What can i do now for learnling perl?
Message-Id: <9cd4098e.0305050755.6378835c@posting.google.com>

Hello everyone:
   I am a newbie of perl.I just learn the perl for 2 weeks.And i have read the 
<<learning perl>>.What could i do now for the next learning?Do some coding? or
reading the <<programming perl>> or do some cgi exercise?
   Please give me some advices for my study.
   Thanks very much!


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

Date: Mon, 05 May 2003 16:38:07 GMT
From: William Goedicke <goedicke@goedsole.com>
Subject: Re: What can i do now for learnling perl?
Message-Id: <m3el3dqrh5.fsf@mail.goedsole.com>

Dear Kevin - 

jl.cd@163.com (kevin) writes:

> What could i do now for the next learning?Do some coding?

Do some coding.  You can get perl at: http://www.perl.com.

     Yours -      Billy

============================================================
     William Goedicke     goedicke@goedsole.com            
                          http://www.goedsole.com:8080      
============================================================

          Lest we forget:

War is caused by the squabling of princes.

		- Machievelli


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

Date: Mon, 5 May 2003 22:12:07 +0530
From: "Kasp" <kasp@epatra.com>
Subject: Re: What can i do now for learnling perl?
Message-Id: <b964du$6vh$1@newsreader.mailgate.org>

How about doing some coding along with some reading side-by-side?

Code what you read,
Read what you code ( and improvise )!
--
"Accept that some days you are the pigeon and some days the statue."
"A pat on the back is only a few inches from a kick in the butt." - Dilbert.
"kevin" <jl.cd@163.com> wrote in message
news:9cd4098e.0305050755.6378835c@posting.google.com...
> Hello everyone:
>    I am a newbie of perl.I just learn the perl for 2 weeks.And i have read
the
> <<learning perl>>.What could i do now for the next learning?Do some
coding? or
> reading the <<programming perl>> or do some cgi exercise?
>    Please give me some advices for my study.
>    Thanks very much!




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

Date: Mon, 05 May 2003 19:15:15 +0200
From: "Nico Coetzee" <abuse@mweb.co.za>
Subject: Re: What can i do now for learnling perl?
Message-Id: <pan.2003.05.05.17.15.13.156084@mweb.co.za>

On Mon, 05 May 2003 08:55:04 -0700, kevin wrote:

> Hello everyone:
>    I am a newbie of perl.I just learn the perl for 2 weeks.And i have read the 
> <<learning perl>>.What could i do now for the next learning?Do some coding? or
> reading the <<programming perl>> or do some cgi exercise?
>    Please give me some advices for my study.
>    Thanks very much!

Start by creating problems you want to solve. For example:

1) Build a script to some stats on text documents ( total nr. of words;
nr. of sentences; nr of paragraphs etc. )

This should sort out most of the basics. Then move on to:

2) Create a simple contacts/MP3/whatever database ( MySQL ) and interface
to it with Perl. At the end, design a GUI ( ncurses/Tk ).

And then, as the grand prise:

3) Do a small dynamic web site in Perl.

After you have completed these exercises you should understand just about
all the basic concepts of Perl as well as how to use Modules (
http://search.cpan.org/ ) and how to interface with other applications (
like databases ).

From here on, it's all up to the day-to-day problems.

Cheers

-- 
Nico Coetzee

http://www.itfirms.co.za/
http://za.pm.org/
http://forums.databasejournal.com/

To the systems programmer, users and applications serve only to provide a
test load.



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

Date: 05 May 2003 18:48:27 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: What can i do now for learnling perl?
Message-Id: <slrnbbdcfr.fj.abigail@alexandra.abigail.nl>

kevin (jl.cd@163.com) wrote on MMMDXXXIV September MCMXCIII in
<URL:news:9cd4098e.0305050755.6378835c@posting.google.com>:
``  Hello everyone:
``  I am a newbie of perl.I just learn the perl for 2 weeks.And i have read the 
`` <<learning perl>>.What could i do now for the next learning?Do some coding? o
``  reading the <<programming perl>> or do some cgi exercise?


I just can't imagine learning Perl (or any other language) without doing
coding. Reading a book is one thing, but most of it has to come from
writing code.



Abigail
-- 
print 74.117.115.116.32, 97.110.111.116.104.101.114.32,
      80.101.114.108.32, 72.97.99.107.101.114.10;


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

Date: Mon, 05 May 2003 19:06:34 GMT
From: "Herb Martin" <News@LearnQuick.Com>
Subject: Re: What can i do now for learnling perl?
Message-Id: <_Cyta.35870$8e7.1427679@twister.austin.rr.com>

I think all the respondes said it:  Do some coding.

Write a program -- then another one.

It helps if you wish to solve some problem for
yourself (or a friend or co-worker).

Pick a problem and design a program to HELP
solve it --it does not have to be a 100% solution.

A program that does 90% of the work and lets
you do the other 10% easily can be much quicker
to create than one that tries to "do it all."

Pick something -- write a solution.

Then if you don't like the results, re-write it to do
a better job OR pick something else and write
another solution....

--
Herb Martin
Try ADDS for great Weather too:
http://adds.aviationweather.noaa.gov/projects/adds

"kevin" <jl.cd@163.com> wrote in message
news:9cd4098e.0305050755.6378835c@posting.google.com...
> Hello everyone:
>    I am a newbie of perl.I just learn the perl for 2 weeks.And i have read
the
> <<learning perl>>.What could i do now for the next learning?Do some
coding? or
> reading the <<programming perl>> or do some cgi exercise?
>    Please give me some advices for my study.
>    Thanks very much!




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

Date: Mon, 05 May 2003 15:59:20 -0400
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: Why is POE idle most of the time?
Message-Id: <3EB6C298.A2624B35@earthlink.net>



jtd wrote:
> 
> I wrote a simple test script using POE that created a single session
> with a single handler that simply incremented a counter (0..1000) and
> then yielded to itself. The script took 10s to run. When I profiled
> it, dprofpp showed that the total user+system time was less than 0.8s.
> 
> What is happening here? Shouldn't POE use as much CPU time as the OS
> scheduler allows?
> 
> Jtd

Maybe there were other things running on your computer?

-- 
$a=24;split//,240513;s/\B/ => /for@@=qw(ac ab bc ba cb ca
);{push(@b,$a),($a-=6)^=1 for 2..$a/6x--$|;print "$@[$a%6
]\n";((6<=($a-=6))?$a+=$_[$a%6]-$a%6:($a=pop @b))&&redo;}


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

Date: Mon, 05 May 2003 19:20:28 GMT
From: "Sam Jesse" <samj@austarmetro.com.au>
Subject: Re: writing in a new file
Message-Id: <3eb6b97b@news.comindico.com.au>

thanks. I read the other replies from John and Bart and both are very
helpful thanks to all.

when I type
C:\>perl perldoc fprint
No documentation found for "fprint".
am I doing it wrong or how can I find it.

thanks
Sam


"Xavier Noria" <fxn@hashref.com> wrote in message
news:b951s4$a74$1@news.ya.com...
> In article <3eb5f160@news.comindico.com.au>, Sam Jesse wrote:
>
> : #!/perl -w
> : use strict;
> : use LWP::Simple;
> : my $url= 'http://www.abc.com/nn.shtml');
> : my $content = get $url; #oh.. is there a way to find out if the
connection
> : is alive before going further from here
>
> Read what happens if that call fails in the documentation of the function
> get() available with the incantation perldoc LWP::Simple.
>
> : my $path = 'C:/1/2/nn.shtml';
> : if ($content){
> :  open(FILE, "> $path") || die "file, $path, no good $!";
> : <<write the $content into the file>> ??? help needed
>
> How to write to FILE is explained in perldoc -f print.
>
> -- fxn
>




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

Date: 5 May 2003 20:16:14 GMT
From: sholden@flexal.cs.usyd.edu.au (Sam Holden)
Subject: Re: writing in a new file
Message-Id: <slrnbbdhke.7q0.sholden@flexal.cs.usyd.edu.au>

On Mon, 05 May 2003 19:20:28 GMT, Sam Jesse <samj@austarmetro.com.au> wrote:
> thanks. I read the other replies from John and Bart and both are very
> helpful thanks to all.
> 
> when I type
> C:\>perl perldoc fprint
> No documentation found for "fprint".
> am I doing it wrong or how can I find it.

"-f print" is not the same as "fprint".

-- 
Sam Holden



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

Date: Mon, 05 May 2003 21:17:57 GMT
From: "Sam Jesse" <samj@austarmetro.com.au>
Subject: Re: writing in a new file
Message-Id: <3eb6d504@news.comindico.com.au>

sorry, I did not explain myself correctly, let me have another go.
C:/perl perldoc -f print
Can't open perl script "perldoc": No such file or directory


"Sam Holden" <sholden@flexal.cs.usyd.edu.au> wrote in message
news:slrnbbdhke.7q0.sholden@flexal.cs.usyd.edu.au...
> On Mon, 05 May 2003 19:20:28 GMT, Sam Jesse <samj@austarmetro.com.au>
wrote:
> > thanks. I read the other replies from John and Bart and both are very
> > helpful thanks to all.
> >
> > when I type
> > C:\>perl perldoc fprint
> > No documentation found for "fprint".
> > am I doing it wrong or how can I find it.
>
> "-f print" is not the same as "fprint".
>
> --
> Sam Holden
>




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

Date: 5 May 2003 21:42:56 GMT
From: sholden@flexal.cs.usyd.edu.au (Sam Holden)
Subject: Re: writing in a new file
Message-Id: <slrnbbdmn0.8s0.sholden@flexal.cs.usyd.edu.au>

On Mon, 05 May 2003 21:17:57 GMT, Sam Jesse <samj@austarmetro.com.au> wrote:
> sorry, I did not explain myself correctly, let me have another go.
> C:/perl perldoc -f print
> Can't open perl script "perldoc": No such file or directory

"perl perldoc -f print" is not the same as "perldoc -f print".

Is it that hard to copy a command from a post?

-- 
Sam Holden



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

Date: Mon, 05 May 2003 21:59:57 GMT
From: "Sam Jesse" <samj@austarmetro.com.au>
Subject: Re: writing in a new file
Message-Id: <3eb6dedc$1@news.comindico.com.au>

I must had too much to drink yesterday.. I have it working.. thanks again

Sam

"Sam Holden" <sholden@flexal.cs.usyd.edu.au> wrote in message
news:slrnbbdmn0.8s0.sholden@flexal.cs.usyd.edu.au...
> On Mon, 05 May 2003 21:17:57 GMT, Sam Jesse <samj@austarmetro.com.au>
wrote:
> > sorry, I did not explain myself correctly, let me have another go.
> > C:/perl perldoc -f print
> > Can't open perl script "perldoc": No such file or directory
>
> "perl perldoc -f print" is not the same as "perldoc -f print".
>
> Is it that hard to copy a command from a post?
>
> --
> Sam Holden
>




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

Date: 5 May 2003 10:30:21 -0700
From: qwickfire@hotmail.com (Robert Shaffer)
Subject: XML::DOM parsing error
Message-Id: <3f1bb9b8.0305050930.6c644dd7@posting.google.com>

My code taking a template of an entire OAI metadata record including
everything down from the metadata tag. Anywere in the document a
"cimple" tag can be used like this
<dc:title> 
   Title 
   <cimple>Field_Name</cimple> 
</dc:title> 
My program needs to essentially find nodes named "cimple", get their
child
and then say $data=$self->{Field_Name}, where $self contains all the
data
for each field name under fixed names that the template writer needs
to be
aware of. That "cimple" node then needs to be removed and replaced
with the
data. I couldn't think of a way to do this with perls s// and a regex
so I
turned to XML::DOM. 
I have tried removing the cusom fixed text like "Title" and white
space and the OAI namespace paths etc from the template and saying:

$xp = new XML::DOM::Parser(); 
$doc = $xp->parsefile($xml); 

foreach my $elem ($doc->getElementsByTagName("cimple")){ 
   my $parent=$elem->getParentNode(); 
   my $field=$elem->getFirstChild();#should be text for a field name 
   my $value=$self{$field}; 
   $parent->replaceChild($value,$elem); 
} 
however, no matter what I do if getElementsByTagName finds a node of 
name "cimple" it will give the same error: 
Can't call method "getNodeType" on undefined value at: blah blah
XML\DOM.pm
line blah 
and promptly die 
I used valparser and it prints a warning on every single node. Saying
eg
ERROR-101 undefined ELEMENT  [dc:source], undefined ELEMENT  [cimple],
but
the DOM documentation for ERROR-101 says that defining the element is
not in
the specification.
So have you any idea what I am doing wrong (or even a good reason why
I
shouldn't be doing it this way at all)


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

Date: 5 May 2003 11:07:19 -0700
From: tcnolan@optonline.net (tcnolan)
Subject: XO host can't use CHMOD
Message-Id: <9f360d9e.0305051007.38aeb5d1@posting.google.com>

Hi...

I hope this is the right newsgroup.

I am trying to use EDITTAG.pl for a site that is hosted on XO.  They
do not allow you to use CHMOD.  When the parsescript.cgi tries to open
the file to be edited, I get an error...cannot open file.

I think the line where it breaks is:
(open(IN, "$src"))

I am assuming this is not working because of the permissions of the
file.

It seems XO has a proprietary way to set permissions.  I have called
their support and they seem to feel it is a problem with the script.

Has anyone had this issue with XO hosting and running scripts?

Thank you in advance,

Terry


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

Date: Mon, 5 May 2003 23:59:53 +0530
From: "Kasp" <kasp@epatra.com>
Subject: Re: XO host can't use CHMOD
Message-Id: <b96ajo$gij$1@newsreader.mailgate.org>

> I think the line where it breaks is:
> (open(IN, "$src"))
> I am assuming this is not working because of the permissions of the
> file.

It would be nice if you could post some more section of the script. No point
both of us making wild guesses.

However, to be sure that this is the line that is mucking up...convert it to
the following line

open(IN, "$src) or die "Good Guess...I am the one cribbing $!";

Then try running the script. If you get this error message then you have
narrowed down your problem.
--
"Accept that some days you are the pigeon and some days the statue."
"A pat on the back is only a few inches from a kick in the butt." - Dilbert.





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

Date: 05 May 2003 18:55:09 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: XO host can't use CHMOD
Message-Id: <slrnbbdcsd.fj.abigail@alexandra.abigail.nl>

tcnolan (tcnolan@optonline.net) wrote on MMMDXXXIV September MCMXCIII in
<URL:news:9f360d9e.0305051007.38aeb5d1@posting.google.com>:
??  Hi...
??  
??  I hope this is the right newsgroup.
??  
??  I am trying to use EDITTAG.pl for a site that is hosted on XO.  They
??  do not allow you to use CHMOD.

And on many OSses, even if you were to allow chmod, you couldn't do
anything with it. OS vendors with a basic feel of security won't allow
you to "give away" files. And I doubt "XO" will give you root access.

??  do not allow you to use CHMOD.  When the parsescript.cgi tries to open
??  the file to be edited, I get an error...cannot open file.
??  
??  I think the line where it breaks is:
??  (open(IN, "$src"))
??  
??  I am assuming this is not working because of the permissions of the
??  file.

Why assume? Why not let perl tell you? Check the return value of open,
and if it fails, print the value of $! (see 'man perlvar').

??  It seems XO has a proprietary way to set permissions.  I have called
??  their support and they seem to feel it is a problem with the script.
??  
??  Has anyone had this issue with XO hosting and running scripts?

Well, that's not a topic for this newsgroup, is it? This is about Perl,
not about the policies of some hosting company. Keep your issues with
that company between you and that company - and start using someone
elses services if you feel you aren't getting what you are paying for.

I'm not going to discuss the issues I have with my local bakery here 
either, do I?



Abigail
-- 
sub _'_{$_'_=~s/$a/$_/}map{$$_=$Z++}Y,a..z,A..X;*{($_::_=sprintf+q=%X==>"$A$Y".
"$b$r$T$u")=~s~0~O~g;map+_::_,U=>T=>L=>$Z;$_::_}=*_;sub _{print+/.*::(.*)/s};;;
*_'_=*{chr($b*$e)};*__=*{chr(1<<$e)};                # Perl 5.6.0 broke this...
_::_(r(e(k(c(a(H(__(l(r(e(P(__(r(e(h(t(o(n(a(__(t(us(J())))))))))))))))))))))))


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

Date: 5 May 2003 14:06:43 -0700
From: tcnolan@optonline.net (tcnolan)
Subject: Re: XO host can't use CHMOD
Message-Id: <9f360d9e.0305051306.2e4d1f77@posting.google.com>

Hi...

I should have said the line where it breaks is definitely:

 unless (open(IN, "$src")) {
   print("Content-type: text/html\n\n");
   print("<HTML><HEAD><TITLE>EditTag</TITLE></HEAD>\n");
   print("<BODY BGCOLOR=WHITE>\n");
   print("<H2>Error!</H2>Parse script could not open file $src.\n");
   print("</BODY></HTML>\n");
   die "";
  }

Because the error I get is "Parse script could not open file..." and
the error log file says it dies at that line.

I have used this script with other hosts but I have always been able
to change the permissions on the file to 755.  And the script has run
fine.

Perhaps there are other parameters to the Open function that might
allow me to open and write to a file on this particular host, without
changing the permissions via CHMOD.



Thanks,

Terry


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

Date: Mon, 05 May 2003 21:57:58 GMT
From: Michael Budash <mbudash@sonic.net>
Subject: Re: XO host can't use CHMOD
Message-Id: <mbudash-4BE799.14575505052003@typhoon.sonic.net>

In article <9f360d9e.0305051306.2e4d1f77@posting.google.com>,
 tcnolan@optonline.net (tcnolan) wrote:

> Hi...
> 
> I should have said the line where it breaks is definitely:
> 
>  unless (open(IN, "$src")) {
>    print("Content-type: text/html\n\n");
>    print("<HTML><HEAD><TITLE>EditTag</TITLE></HEAD>\n");
>    print("<BODY BGCOLOR=WHITE>\n");
>    print("<H2>Error!</H2>Parse script could not open file $src.\n");

add this:

print("<P>Here's the error: $!</P>\n");

>    print("</BODY></HTML>\n");
>    die "";
>   }

hth-

-- 
Michael Budash


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

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


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