My thoughts on how to grab all scalers and arrays out of perl file went along the lines of:
open (InFile, "SomeScript.pl");
@InArray = <InFile>;
@OutArray = {};
close (InFile);
$ArrayCount = @InArray;
open (OutFile, ">outfile.txt");
for ($x=0; $x<=$ArrayCount; $x++){
$Testline = @InArray[$x];
if($Testline =~ m/((@|\$)[A-Z]+)/i){
$O...
i'm not certain i'll find an answer but i'd thought this would make for a good brain teaser and or be an enlightening experience or disappointment lol... basically, i need to bat an idea around...
Can i write a function for an asp page that will query my Mac OS X server while using its Spotlight feature?
when you're using a Mac to sear...
Is there a Perl equivalent to the ruby-koans project?
When I was starting to learn ruby a few months ago I stumbled across ruby-koans and it was a huge help for learning the basics of the language.
I now need to poke at some Perl code, and while I've hacked together a few Perl scripts in the past I've never really learned the language,...
I'm trying to do some stuff with FOAF and Perl. I'm unhappy with the current solutions and I want to roll my own. Please do not reference any module other than XML::LibXML.
For reference here is a snippet from a FOAF file
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/...
Possible Duplicate:
The Hostname Regex
I'm trying to use pcrepp (PCRE) to extract hostname from url.
the pcre regular expression is as same as Perl 5 regular expression.
for example:
url = "http://www.pandora.com/#/volume/73";
// the match will be "http://www.pandora.com/".
I can't find the correct syntax of the regex for ...
I believe this question might have been previously attempted in 2006 on a different site. But, my current XML/RDF writer (XML::LibXML 1.70) outputs element namespaces in the form of xmlns attributes. This will exclude people using non-namespace aware parsers who just do a look_down for foaf:Person. I'm wondering if anyone knows of an eas...
Is there a way to store the current state of the built in pseudo-random number generator in Perl so that when my program is run again, it can pick up the sequence from where it left off rather than starting with a new sequence?
Right now, I am storing where I am as well as the initial seed and then throwing away the initial segment whic...
#!usr/bin/perl
@array = ();
open(myfile,"sometext.txt");
while(<myfile>)
{
chomp;
push(@array,[split(" ")]);
}
close(myfile);
print @array[0];
Instead of printing the elements of the first array in this multidimensional array, it outputs the hexadecimal(?) pointer reference. If anyone knows how I can print this array, please po...
I have a data that looks like this
> sq1
foofoofoobar
foofoofoo
> sq2
quxquxquxbar
quxquxquxbar
quxx
> sq3
paxpaxpax
pax
What I want to do is to join them into one lines:
> sq1 foofoofoobarfoofoofoo
> sq2 quxquxquxbarquxquxquxbarquxx
> sq3 paxpaxpaxpax
I tried this code but fail.
sed -e 'te' -e 'H;$!d;:e' -e 'x;/^$/d;s/\n//g'
Wh...
Is it possible to add the -w tag to the first line of a perl program, then run the program from a shell like bash or dos and write all of the warnings into a file?
perl somescript.pl > somefile.txt
This is a throwback to desk checking COBOL programs at school. I'd like to have all of the warnings in front of me on a piece of paper so ...
After a lot of experiments, I still can't get the following script working. I need some guidance on how to diagnoze this particular Perl problem. Thanks in advance.
This script is for testing the use of Office 2007 OCR API:
use warnings;
use strict;
use Win32::OLE;
use Win32::OLE::Const;
Win32::OLE::Const->Load("Microsoft Office Docum...
I have a file that contain lines that looks like this:
>AF001546_1 [88 - 462] 1 MGQQ
>AF001543_1 [88 - 261] ACGT
Not that each line can contain 6 OR 5 fields. What I want to do is to capture
Fields 1,2,3(num only), 5(num only) and last field (ACGT or MGOQ strings).
So the expected output is this:
>AF001546_1 88 462 MGQQ
>AF001543_1 ...
Hi
Here in Switzerland, people under 26 that have a cell phone contract with Swisscom can send 500 sms per month for free using the website https://xtrazone.sso.bluewin.ch/.
Until a few days ago, this site was structured quite simply, it had a login and an inputbox to enter the sms. That's why i wrote a perl script (http://github.com/g...
Hello,
I have Hash where values of keys are other Hashes.
Example: {'key' => {'key2' => {'key3' => 'value'}}}
How can I iterate through this structure?
...
Hello All,
I would like to use regular expression to extract only @patrick @michelle from the following sentence:
@patrick @michelle we having diner @home tonight do you want to join?
Note: @home should not be include in the result because, it is not at beginning of the sentence nor is followed by another @name.
Any solution, tip,...
Hello,
I've written a web cgi application in perl and before I start to distribute it to clients, I'd like to provide an option for future updates.
I would like to know what are the standard approaches for that using free Linux tools.
It is OK for the server to be stopped during updating.
Thank you,
Spasski
...
I've installed this module to gain access and controls within a Gmail inbox. However, when I try to connect through a small Perl script and test the functionality, I get this error message.
Error: Could not login with those credentials - could not find final URL
Additionally, HTTP error: 200 OK
This is an error built within the Gma...
One of my pet peeves with debugging Perl code (in command line debbugger, perl -d) is the fact that mistakenly printing (via x command) the contents of a huge datastructure is guaranteed to freeze up your terminal for forever and a half while 100s of pages of data are printed. Epecially if that happens across slowish network.
As such, I...
I'm trying to fix my code to enable Perl to recover unneeded data by weakening references and breaking cycles.
I recently asked a question on How to access Perl ref counts and the answer has been working well for me.
For some of my objects, the reference count is > 1 and I don't know why.
Is there a way for me to add a callback or som...
I have a need to upgrade a Perl CGI script where the users must complete 3 steps. After they finish each step, the script is logging which step the user completed. Having a record of this is important so we can prove to the user that they only finished step one and didn't complete all three steps, for example.
Right now, the script is...