perl - Google Blog Search: Grant Update: Improvements to Dist::Zilla - The Perl Foundation

The Perl Foundation. Grant Update: Improvements to Dist::Zilla. By Ricardo Signes on March 15, 2010 2:29 PM | No Comments. Ricardo began work on his grant at the beginning of the month and has made steady progress, completing the first ...

perl - Google Blog Search: PERL Mortgage :: Your Lender for Life » Inflation Looming?

PERL Mortgage is an Illinois residential mortgage licensee (MB0004358) and equal housing lender. Toll Free: 888.562.6626. Main Office: 773.862.1530 Fax: 773.862.1536. Email: perl@perlmortgage.com. Address: 2936 West Belmont, ...

perl - Google Blog Search: Recruitment In Synergy Computer Solutions Intl Ltd As Oracle ...

Job Description: Should be able to work as a Perl Script / Oracle Database developer. Should have very good experience in Perl. The key responsibility will be to develop Oracle procedures and Perl Scripts. The developer should be able ...

active questions tagged perl - Stack Overflow: convert perl map with multiple key to c++

I want to convert a code from perl to c++, and my problem is multi key map in perl! example:

perl:

$address{name}{familyName} = $someAddress;

and keys are not unique. I want similar data structure in c++ using map or ...!? also I want to search and obtain values with first key for example I want such %keys{name} in c++ .

perl - Google Blog Search: Nginx Maillist: Re: nginx, fcgi+perl forking a new process per ...

Re: nginx, fcgi+perl forking a new process per request ... Hi Maxim,. > > When I kick a jmeter test against the server I can see dozens of processes > > forked by the 5548 the master FCGI process. As understood I should not ...

Perl@WordPress: What Lionel can teach you about Object Oriented Programming..

St Patrick's Parade - NYC 2009

Bejesus, top of the morning to you!

The beginning of another week in the 2010 Millionaire office and I realise that things have been fairly quiet on this front just from the number of people who’ve been banging on the door asking “what the devil has been going on?” “where are the updates?”.

When I say “banging” I mean, “calling” and unfortunately “the door” being my office phone.

Unfortunately it’s been ridiculously busy at work, and have spent the remainder of my time sat infront of the PC retouching wedding images. That’s not to say “unfortunately” about retouching, because I find it really relaxing and therapeutic, but just that I haven’t had much time to do anything else.

Also after more than 7 long years working at the same company I resigned a couple of weeks ago, which must have been one of the most difficult decisions I’ve had to make, maybe just because of the amount of weight I’d poured on it – but also as a testament to how much I think of the people I’ve had the opportunity of working with for so long.

I’ve got 4 weeks off from this Friday, the sun is coming out over central London and it’s difficult not to feel positive about life in general. Wedding enquiries have been going through the roof (7 in the last week) and have had 2 international bookings for this summer.

Since this week is my last week of work after so long I’ve found myself thinking “this is one of the last cups of tea I will make”, or “this is the last time I’ll walk thru the building atrium” and it dawned on me that there is only a fixed, finite number of times you’ll do anything in life. Obviously the same doesn’t apply to watching sunrise/sunsets and making cups of tea, but it’s made me think I’m going to try and stop taking these tiny events for granted, and in the same way you try and take in everything the last time you know you’ll see someone I’m finding myself thinking the same about my favourite office mug.

Have spent a fair bit of time coding, getting really interested in backtesting spread betting strategies from Malcolm Pryor’s book for spotting medium/long term UK stocks. What had been holding me back was just being able to find all the data that I wanted online, but glad to say it’s out there in the public domain – and I think am a couple of days away from having a nice automated perl script pumping out little graphs with entry & exit points, stop losses and returns.

Most of this week is going to be spent tying up loose ends, taking home 7 years worth of accumulated stuff from under my desk and maybe contributing a few C# interview questions to our list. The best interview questions I can think of though are:

LionelLionel Richie’s “3 Times a Lady” – the ultimate make up, or break up song .. discuss? (10 points)

Lionel Richie’s “Hello” – do you think that Lionel is describing a singleton pattern in C#? Or the song is more about loose coupling of objects? (10 points)

Lionel Richie’s “Say you, Say me” – describe what you think Lionel is telling us about C#’s model for event-handling and delegates? (10 points)

Photo today is from last year’s St Patrick’s day parade through New York.

perl - Google Blog Search: Nginx Maillist: Re: nginx, fcgi+perl forking a new process per ...

Re: nginx, fcgi+perl forking a new process per request ... Hello! On Mon, Mar 15, 2010 at 02:13:28PM +0200, Stefan Parvu wrote: > Im trying to experiment more regarding nginx + fcgi,perl. Im using the > following configuration: ...

perl - Google Blog Search: Nginx Maillist: nginx, fcgi+perl forking a new process per request ...

nginx, fcgi+perl forking a new process per request ... Hi,. Im trying to experiment more regarding nginx + fcgi,perl. Im using the following configuration: OS: Solaris 10 x86. Perl CGI support: nginx-fcgi-0.4.3 ...

perl - Google Blog Search: is it possible to schedule a script to run each time I recieve a ...

On a regular basis, download a copy of the mailbox file (most *nix systems keep the user mail in a single file), and write a Perl script to parse through it, break it up into fields, and write it out to the database. ...

perl - Google Blog Search: Spamassassin Milter Plugin Remote Root Attack, (Mon, Mar 15th ...

The perl script collects some information about the local host and tries to send it to 203.59.123.114 on port 80 -- this host appears to be unreachable at the moment though. Cheers, Adrien de Beaupr EWA-Canada.com.

perl - Google Blog Search: whats the difference between NT server and Linux for web hosting ...

Simple html? dynamic content? perl? asp? jsp? etc. - Whats the network traffice you expect - What is your preferred scripting language? - How much money can you afford? etc etc. Basically, you need to compare based on those (and a few ...

perl - Google Blog Search: Bagesh Singh - New Delhi, India Travel Blog

the administrator usually knows the script, such as PHP, Perl, and JavaScript languages. They may also need to know how to configure a Web server such as Apache, and as a server administrator. A site administrator to another is defined ...

perl - Google Blog Search: A new website Scriptsdesk launched providing all kinds of ...

A new scripts directory website called scriptsdesk has been launched and it has the collections of many programming scripts like php scripts,asp scripts,asp.net scripts,perl scripts and many more scripts and web programming resources. ...

perl - Google Blog Search: hype-free: In praise of Regexp::Assemble

...and of the Perl modules in general. I had the following problem: Given a list of 16 character alphanumeric IDs, find all the lines from a large-ish (~6GB) logfile which contain at least one of the IDs. ...

perl - Google Blog Search: Sams Teach Yourself Perl in 24 Hours

Publisher Sams edition PDF mb Learn Perl programming quickly and easily with one hour lessons in Sams Teach Yourself Perl in Hours The book&rsquo s step by step lessons teach you the 195138.

rho's blog: Graphics::DZI Developer Release

This weekend I managed to package up Graphics::DZI. It is a naive implementation of the DeepZoom mechanism as used in Seadragon.

The API is not completely stable; first I will have to integrate the piece into my semantic map generation infrastructure.

I also need to better understand how to deal with very sparse maps.

perl - Google Blog Search: Perl – How to Read a Text File into a Variable « Shafiq Issani

Perl – How to Read a Text File into a Variable. 15 03 2010. If you are working with large file(s) you might consider using File::Slurp. It is much fast than the conventional: { local $/=undef; open FILE, "myfile" or die "Couldn't open ...

perl - Google Blog Search: PhpGmailToolkit for Scripts 0.2.1a - Free PhpGmailToolkit for ...

PhpGmailToolkit for Scripts 0.2.1a, Downloads: 1, License: Freeware, By: Rahat Ayub, Size: 0.08 MB. PhpGmailToolkit provides simple yet useful scripts developed in PHP & Perl to enjoy Gmail facilities.

perl - Google Blog Search: c0li.m0de.0n: Simple SQLi Dumper v5.0 for MySQL

[ander@vps]$ perl ssdp.pl -u http://www.460productions.com/store.php?cat=2+AND+1=2+UNION+ALL+SELECT+c0li,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24 -d 460store -table ...

perl - Google Blog Search: The Cube Host – Shared & Reseller Hosting – 25% off for life ...

PHP/Perl/CGI-BIN/Zend/Curl/Ruby-on-Rails * Order Now! ...

perl - Google Blog Search: Package Modify Mysql Flex Program - iDevOpen.com Forums's blog

I need a really good coder familiar with MySql PHP Perl and Flex Basically go visit promodraw com click on the quot try it now quot button to see the actual program in action This will give you an idea of... (Budget $100-$250, Required ...

perl - Google Blog Search: Sawyer X at blog.perls.org: Modules vs. Applications

Since the majority of Perl programmers are actually sysadmins by day [and superheroes by night], we're accustomed to writing pieces of software, "modules". We have CPAN to host all these modules. Occasionally we might write a program, ...

perl - Google Blog Search: Lisp, the Universe and Everything: What's on Coders' Minds?

These include: Fortran, Assembler, Python, JavaScript, BASIC, Perl and Pascal. All were mentioned by 6 to 10 people. Among them Assembler, BASIC and Pascal are obviously mostly out of use, but were the three most mentioned first ...

active questions tagged perl - Stack Overflow: How to get colored output with printf?

Hello, is there a way to get with printf colored output?

#!/usr/bin/perl
use warnings; 
use strict;
use Term::ANSIColor;

printf "%4.4s\n", colored( '0123456789', 'magenta' );

Output: (only newline)

perl - Google Blog Search: Perl's Wisdoms

Perl's Wisdoms. Monday, 15 March 2010. Unveils NEW website http://bit.ly/c9Z3iV & email mark@markperl.com Now ... Subscribe Now: text. Subscribe to Perl's Wisdoms. Plaxo Badge. Links to my websites. My MC/Conference Facilitator site ...

active questions tagged perl - Stack Overflow: Best way to do text processing in linux/mac ?

I generally need to do a fair amount of text processing for my research, such as removing the last token from all lines, extracting the first 2 tokens from each line, splitting each line into tokens, etc.

What is the best way to perform this ? Should I learn Perl for this? Or should I learn some kind of shell commands? The main concern is speed. If I need to write long code for such stuff, it defeats the purpose.

perl - Google Blog Search: Developing Web Applications with Apache, MySQL, memcached, and ...

Developing Web Applications with Apache, MySQL, memcached, and Perl (Wrox Programmer to Programmer) : The only book to address using cache to enhance and.

perl - Google Blog Search: 车前草: Section 1.7. Comparing Python

Perl's greatest strength is in its string pattern matching ability, providing an extremely powerful regular expression matching engine. This has pushed Perl to become the de facto language for string text stream filtering, recognition, ...

perl - Google Blog Search: CodeGenX 1.0 - Free CodeGenX Download at Downloadplex.com

Perl Dev Kit (Windows) 8.2.1 icon Perl Dev Kit (Windows) 8.2.1. Perl Dev Kit creates and deploys professional Perl applications. 04-03-2010 05:08:08 | Commercial | Downloads: (130). Tag: activestate, perl dev kit, perl, activestate perl ...

perl - Google Blog Search: How do I export a MySQL table from Yahoo Web Hosting without ...

You can use PERL instead of PHP. Please refer the following URL: http://help.yahoo.com/l/us/yahoo/smallbusiness/webhosting/mysql/mysql-12.html. You can get more help from: http://help.yahoo.com/l/us/yahoo/smallbusiness/webhosting/mysql/ ...

perl - Google Blog Search: Linux System Administration Recipes: Internet A Problem-Solution ...

Author Juliet Kemp takes a broad approach to scripting using Perl and bash, and all scripts work on Debian or Red Hat lineage distributions. Plus she dispenses wisdom about time management, dealing with desperate colleagues, ...

perl - Google Blog Search: Perl Tutorial 1 – Active Perl, Perl Editor, Hello World

ALL 125 PERL VIDEOS ARE NOW AVAILABLE TO STREAM AT: www.scriptsocket.com Part 1 of the Perl Tutorial features details on where to download Active Perl,

perl - Google Blog Search: What career can I make with C+, C++, perl and a good learning ...

I am graduate student in chemistry but want to change career to computer field. I am planning to learn languages such as C+, C++, perl and I am so good in.

perl - Google Blog Search: Web Programming Basics | Autopilot Mastery

The proficient web programmers are well acquainted with an array of cutting edge web technology and software languages such as, Windows NT, Java, Servlets, MySQL, MSSQL, Oracle and MSAccess, JavaScript, WAP Applets, EJB, Perl. ...

perl - Google Blog Search: Perl Scripts

Download ebooks, Software and information for Perl Scripts . 100% Safe and Secure Perl Scripts ebooks and downloads. Updated Daily. Perl Scripts Directory of ebooks, software and information Downloads.

active questions tagged perl - Stack Overflow: Performing an http redirect in Perl

Hello, I want to perform an http redirect, but the way i am currently doing it isn't working. When i try redirect it just prints the status code, and the location header

my $q = new CGI;
q->redirect(" http://www.google.com ");

active questions tagged perl - Stack Overflow: How do I return a perl variable to a .ksh script?

I have a .ksh script that calls a perl pgm. The perl pgm creates some important data that the .ksh script needs to act on. Example:

.ksh pgm

#!/usr/bin/ksh
abc.pl > $logFile
# perl pgm creates variable $importantData   See below.
#  HOW DO I GET THE .KSH SCRIPT TO SEE $importantData  ???
def.ksh $importantData  # send important data to another .ksh script
exit

.

Perl pgm

$importantData = somefunction();
exit;

active questions tagged perl - Stack Overflow: counting paragraphs in text file

I need to create perl code which allows counting paragraphs in text files. I tried this and doesn't work:

open(READFILE, "<$filename")
or die "could not open file \"$filename\":$!";

$paragraphs = 0;

my($c);

while($c = getc(READFILE))
{
if($C ne"\n")
{
$paragraphs++;
}
}

close(READFILE);

print("Paragraphs: $paragraphs\n");

active questions tagged perl - Stack Overflow: Is there a way to get the PREMATCH ($`) and POSTMATCH ($') from pcrecpp?

Is there a way to obtain the C++ equivalent of Perl's PREMATCH ($`) and POSTMATCH ($') from pcrecpp? I would be happy with a string, a char *, or pairs indices/startpos+length that point at this.

StringPiece seems like it might accomplish part of this, but I'm not certain how to get it.

in perl:

$_ = "Hello world";
if (/lo\s/) {
    $pre = $`; #should be "Hel"
    $post = $'; #should be "world"
}

in C++ I would have something like:

string mystr = "Hello world"; //do I need to map this in a StringPiece?
if (pcrecpp::RE("lo\s").PartialMatch(mystr)) { //should I use Consume or FindAndConsume?
   //What should I do here to get pre+post matches???
}

pcre plainjane c seems to have the ability to return the vector with the matches including the "end" portion of the string, so I could theoretically extract such a pre/post variable, but that seems like a lot of work. I like the simplicty of the pcrecpp interface.

Suggestions? Thanks!

--Eric

active questions tagged perl - Stack Overflow: Strange thread behavior in Perl

Tom Christiansen's example code (à la perlthrtut) is a recursive, threaded implementation of finding and printing all prime numbers between 3 and 1000.

Below is a mildly adapted version of the script

#!/usr/bin/perl
# adapted from prime-pthread, courtesy of Tom Christiansen

use strict;
use warnings;
use threads;
use Thread::Queue;

sub check_prime {       
    my ($upstream,$cur_prime) = @_;     
    my $child;
    my $downstream = Thread::Queue->new;

    while (my $num = $upstream->dequeue) {          
        next unless ($num % $cur_prime);

        if ($child) {

            $downstream->enqueue($num);

        } else {

            $child = threads->create(\&check_prime, $downstream, $num);

            if ($child) {

                print "This is thread ",$child->tid,". Found prime: $num\n";

            } else {

                warn "Sorry. Ran out of threads.\n";
                last;
            }
        }
    }

    if ($child) {
        $downstream->enqueue(undef);
        $child->join;
    }
}

my $stream = Thread::Queue->new(3..shift,undef);
check_prime($stream,2);

When run on my machine (under ActiveState & Win32), the code was capable of spawning only 118 threads (last prime number found: 653) before terminating with a 'Sorry. Ran out of threads' warning.

In trying to figure out why I was limited to the number of threads I could create, I replaced the use threads; line with use threads (stack_size => 1);. The resultant code happily dealt with churning out 2000+ threads.

Can anyone explain this behavior?

active questions tagged perl - Stack Overflow: [Perl] Testing for EAGAIN / EWOULDBLOCK on a recv

I'm testing a socket to see if it's still open:

        my $dummy = '';
        my $ret = recv($sock, $dummy, 1, MSG_DONTWAIT | MSG_PEEK);
        if (!defined $ret || (length($dummy) == 0 
                && $! != EAGAIN && $! != EWOULDBLOCK )) {
            logerr("Broken pipe? ".__LINE__." $!");
        } else {
            # socket still connected, reuse
            logerr(__LINE__.": $!");
            return $sock;
        }

I'm passing this code a socket I know for certain is open and it's always going through the first branch and logging "Broken pipe? 149 Resource temporarily unavailable".

I don't understand how this is happening since "Resource temporarily unavailable" is supposed to correspond to EAGAIN as far as I know.

I'm sure there must be something simple I'm missing. And yes, I know this is not a full proof way to test and I account for that.

active questions tagged perl - Stack Overflow: How can I find out the original username a process was started with?

There is a perl script that needs to run as root but we must make sure the user who runs the script did not log-in originally as user 'foo' as it will be removed during the script.

So how can I find out if the user, who might have su-ed several times since she logged in has not impersonated 'foo' at any time in that chain?

I found an interesting perl script that was calling the following two shell scripts, but I think that would only work on Solaris.

my $shell_parent = 
`ps -ef | grep -v grep | awk \'{print \$2\" \"\$3}\' | egrep \"^@_\" | awk \'{print \$2}'`;

my $parent_owner = 
`ps -ef | grep -v grep | awk \'{print \$1\" \"\$2}\' | grep @_ | awk \'{print \$1}\'`;

This needs to work on both Linux and Solaris and I'd rather eliminate the repeated calls to he the shell and keep the whole thing in Perl.

active questions tagged perl - Stack Overflow: What is the fastest way to pull a few element values out of XML files in Perl?

I have a bunch of XML files that are about 1-2 megabytes in size. Actually, more than a bunch, there are millions. They're all well-formed and many are even validated against their schema (confirmed with libxml2).

All were created by the same app, so they're in a consistent format (though this could theoretically change in the future).

I want to check the values of one element in each file from within a Perl script. Speed is important (I'd like to take less than a second per file) and as noted I already know the files are well-formed.

I am sorely tempted to simply 'open' the files in Perl and scan through until I see the element I am looking for, grab the value (which is near the start of the file), and close the file.

On the other hand, I could use an XML parser (which might protect me from future changes to the XML formatting) but I suspect it will be slower than I'd like.

Can anyone recommend an appropriate approach and/or parser?

Thanks in advance.

Update

Here's the structure/complexity of the data I am trying to pull out:

<doc>
  ...
  <someparentnode attrib="notme" attrib2="5">
    <node>Not this one</node>
  </someparentnode>
  <someparentnode attrib="pickme" attrib2="5">
    <node>This is the data I want</node>
  </someparentnode>
  <someparentnode attrib="notme" 
     attrib2="reallyreallylonglineslikethisonearewrapped">
    <node>Not this one either and it may be 
      wrapped too.</node>
  </someparentnode>
  ...    
</doc>

The hierarchy goes a several levels deeper than that, but I think that covers off the sorts of things I am trying to do.

active questions tagged perl - Stack Overflow: fork() in perl on windows

I'm using fork() on Perl in windows (activeperl) for a basic socket server, but apparently there are problems (it won't accept connections after a few times), is there any workaround?

while($client = $bind->accept()) {
    $client->autoflush();
    if(fork()){ $client->close(); }
    else { $bind->close(); new_client($client); exit(); }
}

is the portion of the relevant code.

active questions tagged perl - Stack Overflow: Making a shortcut for a Perl program under Windows using a DOS batch file.

I'm trying to "hide" some of my perl program from the end user to make things easier on them. I'm doing what I can to keep them out of the command prompt. The program itself has a GUI designed in Perl/Tk, so they don't have to worry about the command prompt.

Could I write out a quick batch file that goes along the lines of:

START perl 'C:\[some path here]\myscript.pl'

with START to start a program, the perl interpretor as my program, and the path/name of my perl script as the parameter?

Would I have to specify where to find perl or would Windows just know because perl is in the computer's PATH variable?

Thanks for the help!

active questions tagged perl - Stack Overflow: Can I pass a regex to isa() with Moose-based objects?

Can I use isa in Moose with a regex as a parameter ? If not possible can I achieve the same thing with someothing other than ->isa ?

ok, having the following types Animal::Giraffe , Animal::Carnivore::Crocodile , I want to do ->isa(/^Animal::/), can I do that ? if I can't, what can I use to reach the desired effect ?

active questions tagged perl - Stack Overflow: How to remove lowercase sentence fragments from text?

Hello:

I'm tyring to remove lowercase sentence fragments from standard text files using regular expresions or a simple Perl oneliner.

These are commonly referred to as speech or attribution tags, for example - he said, she said, etc.

This example shows before and after using manual deletion:

  1. Original:

"Ah, that's perfectly true!" exclaimed Alyosha.

"Oh, do leave off playing the fool! Some idiot comes in, and you put us to shame!" cried the girl by the window, suddenly turning to her father with a disdainful and contemptuous air.

"Wait a little, Varvara!" cried her father, speaking peremptorily but looking at them quite approvingly. "That's her character," he said, addressing Alyosha again.

"Where have you been?" he asked him.

"I think," he said, "I've forgotten something... my handkerchief, I think.... Well, even if I've not forgotten anything, let me stay a little."

He sat down. Father stood over him.

"You sit down, too," said he.


  1. All lower case sentence fragments manually removed:

"Ah, that's perfectly true!"

"Oh, do leave off playing the fool! Some idiot comes in, and you put us to shame!"

"Wait a little, Varvara!" "That's her character,"

"Where have you been?"

"I think," "I've forgotten something... my handkerchief, I think.... Well, even if I've not forgotten anything, let me stay a little."

He sat down. Father stood over him.

"You sit down, too,"


I've changed straight quotes " to balanced and tried: ” (...)+[.]

Of course, this removes some fragments but deletes some text in balanced quotes and text starting with uppercase letters. [^A-Z] didn't work in the above expression.

I realize that it may be impossible to achieve 100% accuracy but any useful expression, perl, or python script would be deeply appreciated.

Cheers,

Aaron

active questions tagged perl - Stack Overflow: Do you use an exception class in your Perl programs? Why or why not?

I've got a bunch of questions about how people use exceptions in Perl. I've included some background notes on exceptions, skip this if you want, but please take a moment to read the questions and respond to them.

Thanks.

Background on Perl Exceptions

Perl has a very basic built-in exception system that provides a spring-board for more sophisticated usage.

For example die "I ate a bug.\n"; throws an exception with a string assigned to $@.

You can also throw an object, instead of a string: die BadBug->new('I ate a bug.');

You can even install a signal handler to catch the SIGDIE psuedo-signal. Here's a handler that rethrows exceptions as objects if they aren't already.

$SIG{__DIE__} = sub { 
    my $e = shift; 
    $e = ExceptionObject->new( $e ) unless blessed $e;
    die $e;
}

This pattern is used in a number of CPAN modules. but perlvar says:

Due to an implementation glitch, the $SIG{DIE} hook is called even inside an eval(). Do not use this to rewrite a pending exception in $@ , or as a bizarre substitute for overriding CORE::GLOBAL::die() . This strange action at a distance may be fixed in a future release so that $SIG{DIE} is only called if your program is about to exit, as was the original intent. Any other use is deprecated.

So now I wonder if objectifying exceptions in sigdie is evil.

The Questions

  1. Do you use exception objects? If so, which one and why? If not, why not?

  2. If you don't use exception objects, what would entice you to use them?

  3. If you do use exception objects, what do you hate about them, and what could be better?

  4. Is objectifying exceptions in the DIE handler a bad idea?

  5. Where should I objectify my exceptions? In my eval{} wrapper? In a sigdie handler?

  6. Are there any papers, articles or other resources on exceptions in general and in Perl that you find useful or enlightening.

Cross-posted at Perlmonks.

active questions tagged perl - Stack Overflow: Get Template::Plugin::Date to accept MySQL dates as well as datetimes

I'm using the date plugin for Template::Toolkit (Template::Plugin::Date), it works well with datetimes (yyyy-mm-dd hh:mm:ss) pulled straight out of MySQL, but it will not work with dates (yyyy-mm-dd).

What's the simplest way to get date.format to accept dates (without modifying the sql query)?

Thanks.

active questions tagged perl - Stack Overflow: HTML::Mason file upload

Recently I've been trying to get some files uploaded on to my server in my HTML::Mason application. All good no problems there apparently Mason a filehandle directly in the argument. The problem is that I cannot retrieve the filename from that filehandle in a elegant way. One method of resolving this issue is parsing the filename on the client before sending it to the server and placing the extracted value in a hidden field so that it gets sent upon submit. BUT that is very unsafe!

active questions tagged perl - Stack Overflow: Perl character encoding

I have an environment variable set in Windows as TEST=abc£ which uses Windows-1252 code page. Now, when I run a Perl program test.pl this environment value comes properly.

When I call another Perl code - test2.pl from test1.pl either by system(..) or Win32::Process, the environment comes garbled.

Can someone provide information why this could be and way to resolve it?

The version of perl I am using is 5.8.

If my understanding is right, perl internally uses utf-8, so the initial process - test1.pl received it right from Windows-1252utf-8. When we call another process, should we convert back to Windows-1252 code page?

active questions tagged perl - Stack Overflow: How can I use Perl to concatenate array elements between two indexes?

I have an array of strings: @array

I want to concatenate all strings beginning with array index $i to $j. How can I do this?

active questions tagged perl - Stack Overflow: perl parentheses in regular expression

I have been trying several regular expressions

$str =~ s/^0+(.)/$1/;

converts 0000 to 0 and 0001 to 1

$str =~ s/^0+./$1/;

converts 0000 to empty string, 000100 to 00, 0001100 to 100.

what difference is the parentheses making?

active questions tagged perl - Stack Overflow: how to initialize a 2d array in perl

How do I initialize a 2d array in perl?

I am trying the following code:

 0 use strict;
10 my @frame_events = (((1) x 10), ((1) x 10));
20 print "$frame_events[1][1]\n";

but it gives the following error:

Can't use string ("1") as an ARRAY ref while "strict refs" in use at ./dyn_pf.pl line 20.

This syntax only seems to initialize a 1d array as print "$frame_events[1]\n" works. Though perl doesn't give any error during the assignment.

Perl@WordPress: Perl: Command-line regex

A few command-line tricks for Perl:

  • Filter based on regex (like grep -E)
    cat file.txt | perl -n -e ‘print if /regex.*matched/’
  • Replace based on regex
    cat file.txt | perl -n -e ’s/regex.*matched/replacement/gi’
  • Replace based on regex inside file (will change file)
    perl -pi -e ’s/regex.*matched/replacement/gi’ *.txt
  • Replace based on regex inside file (will change file) and make a backup of original file with .bak extension.
    perl -pi.bak -e ’s/regex.*matched/replacement/gi’ *.txt

Opera Search: Search results for Python Programming

Debian Networking Tutorial for Beginners and advanced users ... The Linux world is chock-full of scripting languages: Perl, Python, PHP, Scheme, Tcl, Tk, ... http://www.unix-tutorials.com/search.php?act=search&term=Python+Programming+for+Beginners...

Opera Search: Mit Perl Anfangen

Auf Linux ist Perl gewöhnlich vorinstalliert. Auf Windows kann man es von ActiveState.com oder StrawberryPerl.com herunterladen. Dank an oylenshpeegul für den Hinweis. (Als ich mit Perl auf Windows anfing, war Strawberry Perl schlechter als ActiveState Pe ......

Opera Search: What to do: If you need to press »Return« "a lot"?

Story: Wanted to install the Net::Twitter module via cpan. After about 10 minutes of constantly pressings the »Return« key, i ranted on IRC and a friend of mine had a brilliant idea! He asked me: "do you have a leatherman?" I indeed own one and he su ......

Opera Search: unique line by perl

#!/usr/env/perl -w use strict; die "Usage: $0 file\n" unless @ARGV; open(my $f, " ) { #chomp; $seen{$_}++; } close($f); foreach my $key (sort keys %seen) { #print "$key\n"; print "$key"; } ...

Opera Search: What is Ruby on Rails

[IMGRIGHT=http://blog.lrdesign.com/wp-content/uploads/2009/12/rails-tutorial-logo-2-300x251.png] What is Ruby? [*]A High Level Programming Language [*]Interpreted like Perl, Python, Tcl/TK. [*]Object-Oriented Like Smalltalk, Eiffel, Ada, Jav ......

Opera Search: LinuxGuruz

Many Links and Tutorials, Articles and FAQ about Linux, Netfilter IPTABLES, Apache Web Server, HTML, PHP, MySQL, PostgreSQL, CGI, Perl, Java, C++, Bash, ... http://www.linuxguruz.com/ ...

Opera Search: Was ist Perl?

Perl ist eine prozedurale modulare teilweise objektorientierte Programmiersprache. Wie viele Skriptsprachen konzentriert sie sich darauf, einfache Dinge einfach zu erledigen (Siehe auch das Döner-Prinzip). Vor allem muss man sich nicht um die Speicherv ......

Opera Search: I can finally build WebKit!

Just last night I figured out how to build WebKit, and now I'm very pleased that I know the proper PATH to set: C:\Qt\qt\bin;C:\GnuWin32\bin;C:\Perl\bin;C:\Qt\mingw\bin;C:\WINDOWS\system32 (may not apply to everyone). I have no idea how long it takes to b ......

Opera Search: Packaging HTML::Tidy for Debian 5.0 "Lenny"

Today at work a collegue asked help in getting the perl module HTML::Tidy working on a newly installed Deban 5.0 "lenny" machine. The module was needed for an intranet system currently running on Debian 4.0 "Etch", but since Etch is being deprecated, the ......

Opera Search: Is there a use for u"æøå" notation in perl?

After struggling a bit with charset issues on MyOpera , mostly because of historical decisions or lack of, specifically agnostic use of strings in databases, I have become friends (love/hate relationship) with Encode , decode_utf8 for reading and encode_u ......

Opera Search: php-software

Our Areas of Expertise in Web programming are: LAMP (Linux Apache Mysql PERL PHP) PHP Web Programming AJAX Programming Ruby On Rails Perl Programming Active Server Pages Active Server Pages.NET CFML http://www.esource-malaysia.co ......

Opera Search: Parrot virtual machine

Parrot is a virtual machine designed to efficiently compile and execute bytecode for dynamic languages. Parrot currently hosts a variety of language implementations in various stages of completion, including Tcl, Javascript, Ruby, Lua, Scheme, PHP, Python ......

Opera Search: svn废弃了

perl -e '@l=`locate svn`; map {chomp; -d && /.svn$/ && `sudo rm -r $_`;} @l;'

Opera Search: The Perl Programming Language//Flexible & Powerful

Perl is a highly capable, feature-rich programming language with over 22 years of development. More about why we love perl. http://www.perl.org/

Opera Search: Các Lệnh Thường Dùng Trong Unix

Zip các file lại thành file archiveFile.tar.gz tar cvf - * | gzip -9c > archiveFile.tar.gz # Tìm các liên kết không Chỉ tới bất kỳ node nào $ find / -type l -print | perl -nle '-e || print'; Link tham khảo: http://www.ibm.com/developerworks/aix/lib ......

Opera Search: Các công cụ để tiến hành hack web

Các công cụ để tiến hành hack web (Tài liệu chỉ mang tính chất tham khảo) Đối với các hacker chuyên nghiệp thì họ sẽ không cần sử dụng những công cụ này mà họ sẽ trực tiếp setup phiên bản mà trang Web nạn nhân sử dụng trên máy của mình để test lỗi . Như ......