perl.beginners
  Home FAQ Contact Sign in
perl.beginners only
 
Advanced search
May 2008
motuwethfrsasuw
   1234 18
567891011 19
12131415161718 20
19202122232425 21
262728293031  22
2008
 Jan   Feb   Mar   Apr 
 May   Jun   Jul   Aug 
 Sep   Oct   Nov   Dec 
2008 2007 2006  
total
perl.beginners Profile…
RELATED GROUPS

POPULAR GROUPS

more...

 Up
  $^I         


Author: Richard Lee
Date: May 11, 2008 15:04

I just looked it up on perldoc perlvar, but I am still not sure what it
does.

$^I The current value of the inplace-edit extension. Use "undef"
to disable inplace editing. (Mnemonic: value of -i
switch.)

I was reading perl cookbook and saw this example, and was wondering what
that is....

if (@ARGV) {
$^I = ".orig";
} else {
warn "$0: Reading from stdin\n" if -t STDIN;
}
2 Comments
  comparing two binary numbers         


Author: Johnson Lau
Date: May 10, 2008 22:09

Dear all,

I need to compare two binary numbers and need perl to return the
number of matching bits.

For example:

$aaa = "10111100";
$bbb = "00101100";

In this case, the number of matching bits is 6.

I know I could split the strings and compare the bits one by one.
However, is there any faster functions for this? I need to compare
millions of such strings with 1000 bits for each.

Thanks a lot!!

Johnson Lau
6 Comments
  Please help critcize and shorten my sub code         


Author: Richard Lee
Date: May 10, 2008 16:21

I dont know how to go through the array over and over again pending on
my previous search so I ended up writing it like below which works.. but
looks really really
inefficient..

sub dd_fact {
my $routename = shift;
my $routegroupid;
my $trunkgroupid;
my $carriername;
my $carrier_active;
my $carrierid;
AHI: for (@dat) {
if (exists $_->{outsideroute_group_m}{route_name}
and $_->{outsideroute_group_m}{route_name} eq "$routename") {
$routegroupid = $_->{outsideroute_group_m}{route_group_id};
last AHI;
}
}
Show full article (1.53Kb)
7 Comments
  Can't run PERL scripts on a shared server?         


Author: Hotkitty
Date: May 10, 2008 15:57

I've been trying to setup a connection w/ a shared server at
godaddy.com. The script won't work and when I called them they tell me
that because I don't have a dedicated server that I can't run a perl
script and so I need to upgrade my account. I can access the shared
server w/ PHP....why can't I do it w/ PERL? I've gotten bullsh*t
answers from tech support before so thought I'd check here to see if,
indeed, I need to upgrade my account or switch hosting providers. Is
tech support right?
3 Comments
  split slice question         


Author: Richard Lee
Date: May 10, 2008 07:14

I use this before (split slice ) but it's working bit funny now..

can someone tell me why??

it looks like it's splitting on '' instead of /|/ as I have specified
below... ??

use strict;
use warnings;

my $array = q/hi|how|are|you|fine/;

my ($moe,$hae,$now) = (split(/|/,$array))[0,1,2];
print "$moe $hae $now\n";

[root@RLEE ~]# ./!$
././split_practice.pl
h i |
2 Comments
  perl-support for vim help needed         


Author: Richard Lee
Date: May 9, 2008 22:42

does anyone use perl-support for vim here?

I installed it but having trouble bringing up the menus..

does anyone uses this? and know how to bring up the menu?

If the root menu 'Perl' is not visible call it with the item
"Load Perl Support" from the standard Tools-menu.
-- where is this
standard tools-menu?
3 Comments
  Text to hex         


Author: Mark Wagner
Date: May 9, 2008 21:14

Given a string of text, how do I convert it to a string of hexadecimal
values? For example, given the string "Hello", I want the string "48
65 6C 6C 6F".

--
Mark
3 Comments
  Perl MQSeries API newbie help         


Author: Ravi Malghan
Date: May 9, 2008 12:51

Hi: I have very little knowledge about MQ Series. I have built the MQ Client and MQSeries perl API on my server. My MQ admin also has provided me the name of ques, queue manager, MA CHannel, hostname and port. I am trying to build a simple script that will connect to a que and fetch messages. I have not found any useful examples on the web. Can someone share a code ?

Que Name: TRS.E0.CREATE.REMEDY1
Queue manager: SPBO021T
MQ channel: REMEDY.CLIENT
IP: spbo021t.xx.xx.xx
Port: 1424

Thanks
Ravi

____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
no comments
  dns error or module error?         


Author: John Wilson
Date: May 9, 2008 12:40

Trying to install Net::SSLeay on Solaris 9 and I get the following
message in the output:

Use of uninitialized value in subroutine entry at
/m1/shared/perl/5.8.5-09/lib/5.8.5/sun4-solaris/Socket.pm line 373.

Bad arg length for Socket::pack_sockaddr_in, length is 0, should be 4 at
/m1/shared/perl/5.8.5-09/lib/5.8.5/sun4-solaris/Socket.pm line 373.

I've googled parts of this error and get some indication it might have
to do with dns problem, but as far as I know I have no dns problem. Any
advice?

Thanks,

John W.
2 Comments
  script for an mbox         


Author: Tony Heal
Date: May 9, 2008 09:59

I need to remove all messages older than X from a gigabyte size mbox. Anyone
got a script for this?

Tony Heal

Pace Systems Group, Inc.

800-624-5999 x9317
2 Comments
1 2 3