[ foodgun ]

Archive for the ‘perl’ Category

31 Jul, 2007

Since I Can’t Commit This To Memory Either

Posted by: vinny In: perl

Passing inputs to a POST form in a cgi from the command line (to DProf scripts, etc):

echo “attribute=value1+value2…” | perl -d:DProf scriptname.cgi

Alternately, “attribute=value1+value2…” (no quotes) can be in a file, testfile.txt. Then you just:

perl -d:DProf scriptname.cgi < testfile.txt

18 Dec, 2006

Happy 19th, Young Master

Posted by: vinny In: perl| software

Perl 1.0 was released on this day in 1987.

29 Sep, 2005

Since I Can’t Commit This To Memory

Posted by: vinny In: perl| software

The safest way to do perl one-liners is to wrap the parameters within “” (double-quotes) then use q() and qq() inside the parameters. q() and qq() will put whatever is inside them between single-quotes or double-quotes, respectively.

Taken from the ActiveState Perl winfaq4, but edited so it’s real, actual, readable english (with->will in the second sentence).

Well, sometimes it is. Just not this time. My Symbolic References post has another problem. Deep Recursion. I’m calling my ldapsearch sub, which generates warnings in perl like this:

Deep recursion on subroutine “Net::LDAP::sync” at C:/Perl/site/lib/Net/LDAP/Message.pm line 121, line 283.
Deep recursion on subroutine “Net::LDAP::_recvresp” at C:/Perl/site/lib/Net/LDAP.pm line 695, line 283.
Deep recursion on subroutine “Net::LDAP::Search::decode” [...]

05 May, 2005

Ok. I Get it. Symbolic References are Bad.

Posted by: vinny In: perl| software

So I’m working on a program to pull some data from a server and I’m trying to save myself some work. I’m recycling code that I wrote a year(ish) ago, I have a good idea (and a diagram) of what I need to accomplish, and I finally have chunks of free time to work on [...]

19 May, 2004

iPlanet to AD Schema Mapping

Posted by: vinny In: perl| software

Still a work in progress, but it works for simple cases

#!/usr/bin/perl -w

use strict;
use Net::LDAP::LDIF;
use Text::ParseWords;

my %omsyntaxmap = (
# items with no mapping in the next hash are not listed here
‘1.3.6.1.4.1.1466.115.121.1.2′ => ‘64′,
‘1.3.6.1.4.1.1466.115.121.1.3′ => ‘64′,
‘1.3.6.1.4.1.1466.115.121.1.4′ => ‘4′,
‘1.3.6.1.4.1.1466.115.121.1.5′ => ‘4′,
[...]

30 Apr, 2004

How-to use Devel::DProf

Posted by: vinny In: perl| software

Using the Devel::DProf module, a profile of a perl program can be assembled. Usage is simple:
perl -d:DProf program.pl -arg1 -arg2…
This generates a file called tmon.out in the directory with your perl code. This file can be viewed with ‘dprofpp tmon.out‘. Outout looks like this:

Total Elapsed Time = 36.84173 Seconds
User+System Time = 27.61574 Seconds
Exclusive [...]



  • Stevie G: Your ammonia concentration was FAR, FAR, FAR FAR FAR too weak if you got it off the shelf. At most, store bought ammonia is at %5-%10. To proper
  • mja: Thanks a ton mate!
  • vinny: Nelson, Same result if you add to the font-dirs file in the Xming program folder? How 'bout if you launch Xming from the

About

You really need an "about" with all this stuff to read?