Thank you for your responses. The ?: pattern appears to have done it -- seems much better than the workaround I was using in the loop.
Also, thanks (again) for the example of how to use ?: -- I checked out the perldoc page, but I didn't really understand a lot of the jargon surrounding this...
Well, I have part of it figured out, so I wanted to post the results here in case it's helpful.
What this regex does is identifies links within a string. I got the above code to work when I was doing a switch & replace, but I couldn't get it to work when I was trying to put the URLs into an...
I am trying to work with pre-determined links within a string, and while my regex works to replace the pre-determined links, I can't add them to an array to work with them.
Here's my code...
$mystring = qq{ Hello,
My name is red, and I am red like a barn.
http://www.example.com
This is text...
I have been searching for hours for a script that will help me to determine what the CPU usage/load is for a website that I developed locally.
I am running XAMPP on Windows XP
Apache/2.2.4 (Win32)
PHP/5.2.1
mod_perl/2.0.3
Perl/v5.8.8
I've tried to install apache:vmonitor, but I cannot get...
Thank you again, and especially for that link. I've never heard or read a reference of 'zero width positive lookahead assertion' before that I know of.
-Rob
Thank you so much! That worked perfectly, and I've never seen something formatted like that before. . .I might never have figured it out.
The finished code, in case someone else needs to use it:
open(DATA, "data.txt") or die "you stupid script";
while (<DATA>) {
@links = split '(?=http://)'...
I am attempting to reformat the structure of URL's inside a text file, but I am about pulling my hair out.
The urls are like this inside a text file:
http://www.domain.com/http://www.somesite.com/index.phphttp://www. . .
In other words, every URL is butted up next to the other without a...
I am trying to work on a script on my local pc (Windows), but I cannot figure out how to use the "require" command on my computer (that works on my linux hosting account).
Example for my hosting account:
#!/usr/bin/perl
require "somesub.pm";
print "content-type: text/html\n\n";
Example...
Trojan, I had tried using a .htm & .cgi extension on the file with the same results. When I try swapping the content type to text/html the page is blank. As far as writing something to see what headers return, I may have to try that if the suggested module doesn't work. Not sure where the...
You'd probably have to clarify some, but it you are meaning for your personal computer I use apache friends:
http://www.apachefriends.org
Simple install of apache/perl/php/mysql/phpmyadmin.
As far as coding cgi scripts goes between unix/windows it seems to be pretty much the same. There are...
I am trying to create a rss feed for stored database information with the below script.
This setup works on one of my websites (the same hosting account/server) but will not work on another for some reason. What it does is offers the results in a download instead of displaying them in the...
I do have LWP on my hosting account, but I don't have it on my local machine - I'll see if I can install LWP locally & get it working.
No, I've used the same host for 2 years now, I don't want to have to look for another cuz I crashed their servers. . .
Should I be able to get this working...
Any instances of the Image::Size I had seen online always referred to a local file, though I couldn't find where it stated a remote one wouldn't work, but I was thinking it might not work properly for this.
Is LWP something that would be ok to run constantly (and several instances at the same...
Hi,
I am trying to obtain the height and width for an image from another server before it is loaded for the user. This is for an shopping site and images over 300 width mess the page up, so I want to add the height & width tags to anything larger than 300px wide.
I am trying to use...
I have text (articles) with links that I want to transform to html. I am having a hard time figuring out how to change a link like this:
http://example.com
To this:
<a href="http://example.com">http://example.com</a>
I am looking for something like:
$article =~ s/http:. . /<a href=http. ...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.