• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Help with a Perl script

  • Thread starter Thread starter GL
  • Start date Start date

GL

Diamond Member
I need some help with a perl script I'm writing at work.

Basically, this script grabs a HTML file from a server, and searches through it for certain data, and writes this data to a text file.

I'm having problems with the searching of the data. I'm a Java programmer and I know there is an index function in Java which works with a string and accepts a string parameter and returns the location in the first string where there is an instance that matches the string parameter. Is there any function like this in Perl (I'm sure there is!). Any help would be appreciated.

Basically, if I had a string "ABCDEFG", and I wanted to look for "CD", I'd like a function that searches through "ABCDEFG" and returns the location of CD in the string - if you're counting from 0, the location would be 2. I'd then want a function that can get a certain part of a string. Say I wanted CD and 2 letters following CD, I'd want it to return CDEF.

Can anybody help me with these two functions? Thanks in advance!

-GL
 
Back
Top