Anyone Know Perl?

abomb

Registered User
Supporting Member
Joined
Oct 3, 2003
Posts
21,836
Reaction score
1
You must be registered for see images


:shrug:


;)


I almost learned perl once, but chose php instead.

A-Bomb
 

Djaughe

___________________
Supporting Member
Joined
Dec 29, 2003
Posts
27,756
Reaction score
9
Hmmm...this image pops up under google...hope it helps.

You must be registered for see images
 

Ryanwb

ASFN IDOL
BANNED BY MODERATORS
Joined
May 13, 2002
Posts
35,576
Reaction score
6
Location
Mesa
Djaughe said:
Hmmm...this image pops up under google...hope it helps.

That's because the camel is on the cover of the O'Reilly book

:|

Ravi, my co-worker is really good at Perl, what is your question and I'll give it to him. It will seem like I'm working
 

Djaughe

___________________
Supporting Member
Joined
Dec 29, 2003
Posts
27,756
Reaction score
9
Ryanwb said:
...Ravi, my co-worker is really good at Perl, what is your question and I'll give it to him. It will seem like I'm working

Ask yer coworker what the relationship is between camel and Perl...assface wants to know.

You must be registered for see images attach
 
OP
OP
arthurracoon

arthurracoon

The Cardinal Smiles
Joined
Dec 6, 2002
Posts
16,534
Reaction score
0
Location
Nashville
Ryanwb said:
That's because the camel is on the cover of the O'Reilly book

:|

Ravi, my co-worker is really good at Perl, what is your question and I'll give it to him. It will seem like I'm working

actually, I got it figured out

thanks anyway though

:raccoon:
 

Assface

Like a boss
Supporting Member
Joined
May 6, 2003
Posts
15,106
Reaction score
21
Location
Tempe
Djaughe said:
Ask yer coworker what the relationship is between camel and Perl...assface wants to know.

You must be registered for see images attach

:trout:
 

Ryanwb

ASFN IDOL
BANNED BY MODERATORS
Joined
May 13, 2002
Posts
35,576
Reaction score
6
Location
Mesa
arthurracoon said:
actually, I got it figured out

thanks anyway though

:raccoon:

When I say I'll help you, you better damn well accept it. If this was Utah you'd be dead by now :mad:
 

KloD

ASFN Icon
Joined
Dec 31, 2002
Posts
10,374
Reaction score
1
Location
Portland, OR
arthurracoon said:
anyone?

i need some help

Perl rules!!!

Sorry I missed your post, I worked in Perl for a long time and might be able to help in the future, just PM me if you have a question.
 

Yuma

Suns are my Kryptonite!
Joined
Jan 3, 2003
Posts
22,582
Reaction score
12,356
Location
Laveen, AZ
There used to be a brothel in Yuma named Pearl's. So generally speaking, I don't know Perl. Nope. Never heard of her, errr, it. ;)
 
OP
OP
arthurracoon

arthurracoon

The Cardinal Smiles
Joined
Dec 6, 2002
Posts
16,534
Reaction score
0
Location
Nashville
Ok. I have a queston:

$content = "><tr><td valign="top" width="180" nowrap="1" bgcolor="#CCCCFF">Primary SGDID</td><td width="3"> </td><td valign="top">S000004814</td></tr></table></td></tr> <tr><td colspan="2"><center><table cellpadding="2" width="100%" cellspacing="3" border="0"><tr><td><font size="3" face="times"><b>";

#I pulled the HTML off the web (its only a portion of what I get off the web)

#Basically I need to get the S000004814 out of it (in bold)
#This is what I have so far.

if($content =~ /Primary\sSGDID</td><td\swidth="3"\s</td><td\svalign="top">([A-Z]\d+)\n/)
{
print $1;
}

#the problem im having is with the all of the backslashes in there, and maybe the quotes as well
 

KloD

ASFN Icon
Joined
Dec 31, 2002
Posts
10,374
Reaction score
1
Location
Portland, OR
arthurracoon said:
Ok. I have a queston:

$content = "><tr><td valign="top" width="180" nowrap="1" bgcolor="#CCCCFF">Primary SGDID</td><td width="3"> </td><td valign="top">S000004814</td></tr></table></td></tr> <tr><td colspan="2"><center><table cellpadding="2" width="100%" cellspacing="3" border="0"><tr><td><font size="3" face="times"><b>";

#I pulled the HTML off the web (its only a portion of what I get off the web)

#Basically I need to get the S000004814 out of it (in bold)
#This is what I have so far.

if($content =~ /Primary\sSGDID</td><td\swidth="3"\s</td><td\svalign="top">([A-Z]\d+)\n/)
{
print $1;
}

#the problem im having is with the all of the backslashes in there, and maybe the quotes as well

There are several things wrong with the script.

$content = "><tr><td valign="top" width="180" nowrap="1"
bgcolor="#CCCCFF">Primary SGDID</td><td width="3"> </td><td
valign="top">S000004814</td></tr></table></td></tr> <tr><td
colspan="2"><center><table cellpadding="2" width="100%"cellspacing="3"
border="0"><tr><td><font size="3" face="times"><b>";

Two problems with the assignment to $content.
1) This code won't run because the quoting is wrong around the value assigned to $content.
2) You're screen-scraping. This method of retrieving data is notoriously unreliable, since any minor change in the layout of the HTML and data can force him to modify the script. Screen-scraping is to be avoided whenever possible.

if($content =~
/Primary\sSGDID</td><td\swidth="3"\s</td><td\svalign="top">([A-Z]\d+)\n/) {
print $1;
}

Three problems with the pattern above.
1) All of the literal '/' characters have to be escape.
(i.e. </td> should be <\/td>)

2) <td\swidth="3"\s should be <td\swidth="3">\s
(missing '>')

3) You have '\n' at the end of the pattern. Try <\/td>, instead.

- KloD
 
Last edited:
OP
OP
arthurracoon

arthurracoon

The Cardinal Smiles
Joined
Dec 6, 2002
Posts
16,534
Reaction score
0
Location
Nashville
KloD said:
There are several things wrong with the script.



Two problems with the assignment to $content.
1) This code won't run because the quoting is wrong around the value assigned to $content.
2) You're screen-scraping. This method of retrieving data is notoriously unreliable, since any minor change in the layout of the HTML and data can force him to modify the script. Screen-scraping is to be avoided whenever possible.



Three problems with the pattern above.
1) All of the literal '/' characters have to be escape.
(i.e. </td> should be <\/td>)

2) <td\swidth="3"\s should be <td\swidth="3">\s
(missing '>')

3) You have '\n' at the end of the pattern. Try <\/td>, instead.

- KloD

thanks!
:raccoon:

Im gonna try to find some perl modules to directly access the database tommorow, but I wanted to get this working first.

I actually got the $content directly from online. I just used the quotes for this.
 

KloD

ASFN Icon
Joined
Dec 31, 2002
Posts
10,374
Reaction score
1
Location
Portland, OR
arthurracoon said:
thanks!
:raccoon:

Im gonna try to find some perl modules to directly access the database tommorow, but I wanted to get this working first.

I actually got the $content directly from online. I just used the quotes for this.

No problem, 3 years since I've done any programming or used PERL...but I still got it. :)
 

Staff online

Forum statistics

Threads
552,859
Posts
5,403,471
Members
6,315
Latest member
SewingChick65
Top