473,543 Members | 2,446 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Perl Forum

Perl programming language - ask questions about perl programming, syntax, variables, scoping, constructs, operators and functions, files, I/O, regular expressions, regex, subroutines, OO (object oriented), perl modules, CGI and more.
5
1,652
thread by: laurar | last post Apr 2 '08 by: laurar
Hi, I was wondering if someone could figure out why my pointer assignment below won't work! In my code, I try to create a new hash %newhash at the same location as %hashy using the following code: %newhash=%$var; However, if you run the following code you will notice that \%hashy and \%newhash do not contain the same address values. This...
2
3,484
thread by: tanichka | last post Apr 2 '08 by: eggi
Hello you helpful folk! Please look at my script and tell me what I am doing wrong! I am cleaning the names of my music files from unnecessary symbols, and the cleaning works fine, however the perl rename function fails to do the actual renaming. I tried to rename a file in the same dir using strings instead of variables and that works!! But it...
12
2,216
thread by: dillipkumar | last post Apr 2 '08 by: eWish
Hi, I have a Hash: %hash= 'student' => , I want to sort the hash according to sorting of 'roll_no' .. After sorting It should be displayed %hash= 'student' => ,
2
1,578
thread by: Dave Stallard | last post Apr 2 '08 by: Dave Stallard
I'd like to have sets of references (I'm from Java; I'm a Set guy). I understand that you cannot use a reference as a hash key, and that it gets stringified if you try. So, to make my Set object, I've been hashing the reference to itself (or more properly, hashing the stringification to the reference). I would like to not reinvent the...
4
1,768
thread by: cici | last post Apr 1 '08 by: KevinADC
I am having trouble sorting secondary keys in a multi-level hash. I have a sample program that exhibits the problem...the following code is sorting New 6 Month before New 1 Month. What am I doing wrong? Thanks in advance. #!/usr/bin/perl my %data = ( "2008-03-24" => {
6
3,692
thread by: johntology | last post Apr 1 '08 by: johntology
Hello, I've made a two dimensional array using references, which I gather is the only way to do it in Perl. I now need to pass each interior array to a subroutine for processing and can't quite work out the syntax. Here's what I have so far. As you can see, my understanding of Perl falls apart when I get to the subroutine. Any help would...
2
2,577
thread by: HalfCoded | last post Apr 1 '08 by: HalfCoded
Hi everyone, I am currently working at learning perl but come up with two problems i can't clear on my own. I use perl version 5.8 on windows xp The complete I am working on is supposed to find motifs in a sequence. This is the complete code #!/usr/bin/perl -w use strict;
1
4,323
thread by: spatro | last post Apr 1 '08 by: nithinpes
Hi, I am trying to install DBD::mysql using the CPAN and I am facing the following error: cpan> install DBD::mysql CPAN: Storable loaded ok Going to read /root/.cpan/Metadata Warning: Found only 0 objects in /root/.cpan/Metadata CPAN: LWP::UserAgent loaded ok
2
1,474
thread by: shyamsunderc | last post Apr 1 '08 by: shyamsunderc
I am using the following code but iam unable to connect to the IP address. I am unable to understand what is going wrong.... use Net::FTP; $ftp = Net::FTP->new('192.168.1.86') or die "Cannot connect to 192.168.1.86: $@"; $ftp->login("santoshc",'sanju123')
1
2,592
thread by: alanv | last post Apr 1 '08 by: eWish
Hello, I'm having a problem with double quotes, @ symbols and # signs. When a user submits a text field with those symboles for example, its cuts them off like so... INSERT INTO po_item SET po_id='5304', descrip='10@9', price='0.0000' the descrip should have more text after it but a double quote is killing the rest of the input data. ...
4
2,197
thread by: someone124 | last post Apr 1 '08 by: KevinADC
Hi, everyone. I'm trying to find the lowest and the highest numbers that a user has had punched in. The code includes a user punching in 4 different numbers, each on a different line. I need help figuring out how to display the highest and lowest number from the numbers the user typed in and then print them. This is suppose to a very basic code...
3
1,350
thread by: tbest4475 | last post Mar 31 '08 by: KevinADC
AIX I have a set of commands that run and if a difference is found it prints a message to an array and then sends that array in an email. certain messages are not printing the new line after the text. others are. code: $message = "A difference in /opt/local/bin has been noted: $opt_local_bin{$file}{'new'}{'file'} is now available\n";...
1
1,065
thread by: bytemania | last post Mar 31 '08 by: KevinADC
I started learning perl friday!! I have one problem with this code... can someone tell me what is wrong here? #!/usr/bin/perl use strict; use warnings;
7
1,313
thread by: talaai00 | last post Mar 31 '08 by: talaai00
foreach my $x (sort keys %h_temp) { print OUTF2 $h_temp{$x}; chomp; $data = substr($_,43,4); $data2 = substr($_,54,4); $data =~ s/\s+$//; $data2 =~ s/\s+$//;
5
1,580
thread by: winlinfix | last post Mar 31 '08 by: winlinfix
Hi I am using running one perl command using shell scripts, but it won’t take variable #!/bin/sh ar="/usr/local/apache/conf" perl -00ne '/$1/ && print $_' $ar/httpd.conf > domstat.txt I am passing following things on command line ./domcheck.sh domainname.com but perl unable to understand $1 even its not highlight as variable.
6
5,395
thread by: Keith Lee | last post Mar 31 '08 by: Joe Smith
All: I am attempting to compile the perl module Device::SerialPort and get this error during make -- Manifying blib/man3/Device::SerialPort.3pm Can't open blib/man3/Device::SerialPort.3pm for writing: Invalid argument at /usr/lib/perl5/5.8.8/ExtUtils/Command/MM.pm line 132 make: *** Error 22 $ make all Manifying...
4
1,848
thread by: aemado | last post Mar 31 '08 by: KevinADC
I am writing my very first Perl program, and am still lost with how to use split. I have several lines of data that I want to read in, for example: 333444555 Smith Ana Ms RN 777666555 Jones Tom Mr MD These data fields have certain restrictions. The first number always must be exactly 9 digits. The second and third can be up to 9 (anything...
2
7,563
thread by: VinayKumarParakoti | last post Mar 31 '08 by: VinayKumarParakoti
Hi All, I am trying to get the login name of client's machine using Perl. I was under impression that getlogin() will do the job. But this is not giving correct results. Could anypne please help me in finding solution for the same. Thanks in advance.
7
1,690
thread by: Cecil1984 | last post Mar 31 '08 by: KevinADC
hi guys, could any one help me how to write perl script to send email in unix system. thank you for any helping.
16
4,620
thread by: poolboi | last post Mar 31 '08 by: poolboi
hi guys, i've got the code below that extract cell value from an excel sheet but any idea how i continue to output it to a text file? i'm not too sure how to do it, thanks use strict; use Win32::OLE qw(in with); use Win32::OLE::Const 'Microsoft Excel'; $Win32::OLE::Warn = 3; # die on errors...
4
2,921
thread by: Olle24 | last post Mar 30 '08 by: Olle24
I've decrypted a file several times with this script: perl -ne "print map {chr ord ($_) - 54} split //, $_" example.txt They have recently changed the encryption to something else and the command does not work. I wonder if someone could help me with fixing this decryptio, i'm stuck. (It is basicly the same but something is diffrent) This...
4
1,745
thread by: Cecil1984 | last post Mar 30 '08 by: Cecil1984
hi everyone could anyone help to conform the password, my script is following #!/usr/bin/perl use Getopt::Std; getopt('a:u:'); # First command switch, adding a user. if ($opt_a)
5
5,885
thread by: veeraiah | last post Mar 29 '08 by: KevinADC
Hi, I am new to PERL Scripting, i need your help with one of the problem i am having. I am having a PERL Script which has two variables $CurMon and $PriorMon. a Windows batch script calls this PERL Script. I want to return the values of the these two variables to the windows batch script. Can i do this? Please give me some suggestions. ...
1
1,662
thread by: mtanquary | last post Mar 28 '08 by: KevinADC
I have a script that runs in my DEV and PROD environment, but for some reason on my TEST server, I am getting the following error: The script's function is to read from an XML file and load the data to an Oracle table. I believe this error is actually caused by the environment, not sure what yet, but I have checked the DBI and DBD version...
1
2,243
thread by: aplata | last post Mar 28 '08 by: KevinADC
My instructor has asked me to use the pop, shift, and push functions to write a script that sufficiently "shuffles" a simulated deck of cards before printing the top five cards. I came up with the following code but the problem I am having is that I can't seem to shuffle by just using pop, push, and shift. I think the problem for me is trying...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.