perl.beginners
  Home FAQ Contact Sign in
perl.beginners only
 
Advanced search
May 2008
motuwethfrsasuw
   1234 18
567891011 19
12131415161718 20
19202122232425 21
262728293031  22
2008
 Jan   Feb   Mar   Apr 
 May   Jun   Jul   Aug 
 Sep   Oct   Nov   Dec 
2008 2007 2006  
total
perl.beginners Profile…
RELATED GROUPS

POPULAR GROUPS

more...

 Up
  pushing errors to another sub         


Author: Robert Hicks
Date: May 14, 2008 17:25

just "bad" pseudo code:

sub one {
$process->name(\$html) || $errors_from_one( $process->error() );

$process->name(\$text) || $errors_from_one( $process->error() );
}

sub errors_from_one {
my $error = @_;

push (my @errors, $error);

# do stuff to make sure the errors are uniq

return my @uniq_error_list;
}

I want to be able to get at those errors later. Will something like that
work?

Robert
1 Comment
  items in array         


Author: Tech list
Date: May 14, 2008 14:01

what is the correct way to get the number of items in an array?

I used to use $#array
5 Comments
  faster ways than perl?         


Author: Richard Lee
Date: May 14, 2008 13:41

I am running this command on over 2 gigs worth of lines....

which one should be faster?

cut -d'|' -f21 * | sort | uniq -c | sort

perl -F"\|" -lane 'print $F[21]' * | sort | uniq -c | sort

or is there faster ways to do this on perl?
3 Comments
  perl and web         


Author: Richard Lee
Date: May 14, 2008 09:05

Hi guys again!

I am sure this questions been around for while but I am not sure where
to begin.

I am trying to grep a html page given a URL and then extract some
information from the source code.
So something like

open FH, "www.example.com/index.html | " , or die "no way : $!\n";
@array = ;

my $code;
while (@array) {
next if /bleh/;
if ( /^From: (.*)/ ) {
$code = $1;
}
}

You get the idea.. so anyway I did the search
on google
Show full article (0.96Kb)
5 Comments
  initialize data permanently         


Author: Anthony Brooke
Date: May 14, 2008 07:48

Hello, I am using Wordnet::QueryData which allow access to a very huge dictionary data. The initialization of object
my $wn = WordNet::QueryData->new;

took
2 wallclock secs ( 2.36 usr + 0.07 sys = 2.43 CPU)

Then the subsequent request for the data is exetremely fast

For the lines below took
0 wallclock secs ( 0.00 usr + 0.00 sys = 0.00 CPU)

print "Synset: ", join(", ", $wn->querySense("cat#n#7", "syns")), "\n";
print "Hyponyms: ", join(", ", $wn->querySense("cat#n#1", "hypo")), "\n";
print "Parts of Speech: ", join(", ", $wn->querySense("run")), "\n";
print "Senses: ", join(", ", $wn->querySense("run#v")), "\n";
print "Forms: ", join(", ", $wn->validForms("lay down#v")), "\n";
print "Noun count: ", scalar($wn->listAllWords("noun")), "\n";
print "Antonyms: ", join(", ", $wn->queryWord("dark#n#1", "ants")), "\n";

I am developing a web application, is there a way to make the initialization of object permanently in memory ? I tried to use the Storable module. But that only give me a little increase in performance. Anybody's idea is very much appreciated, Thank you.

William

Send instant messages to your online friends http://uk.messenger.yahoo.com
no comments
  Suggestion Box in Perl         


Author: Stephan Gross
Date: May 14, 2008 07:38

Can anyone point me to a source for a form/Perl script for a web-based
anonymous suggestion box?

Thanks!

____________________________________________________________________
Steve Gross
Tel: 212-284-6558
Director of Information Technology Fax:
212-284-6951
www.jesna.org <http://www.jesna.org/>
Cell: 917-575-4028
no comments
  newbie question - handling email addresses         


Author: Munzilla
Date: May 14, 2008 06:53

Hi, I'm 100%% new to Perl but I've been given a project with it anyway,
so I have some pretty basic questions.
The script is used to process a form submitted in PHP. I have it
working fine, but I need to add an email address field now. i was
told that Perl doesn't like the "@" character (which makes sense), and
I know that I could use the backslash, but does Perl treat the
submitted field as an object, or will I have to add some functionality
which adds the backslashes before the form is submitted to the Perl?
Basically, do I need to even worry about the @ symbol if I'm working
with the submitted form fields in Perl, or will the @ still crash the
script?
Thanks.
Munz
2 Comments