473,545 Members | 1,745 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.
1
1,872
thread by: Peter M Aarestad | last post Jul 19 '05 by: Peter M Aarestad
I tried posting this at PerlMonks.org, but didn't get very far... So I wrote a Perl script about 5 months ago to parse a rather strange text file. Here's a sample of the source file: AACE_1: { class: mic_if_win, label: "!AACE.*", mic_if_handles_windows: 1
0
1,978
thread by: Andy | last post Jul 19 '05 by: Andy
I am trying to talk to Winamp2 from Perl on Win32 system. According to winamp docs I need to send a windows message with the following structure: (To add a file to the playlist) COPYDATASTRUCT cds; cds.dwData = IPC_PLAYFILE; cds.lpData = (void *) "file.mp3"; cds.cbData = strlen((char *) cds.lpData)+1; // include space for null...
11
2,917
thread by: Troll | last post Jul 19 '05 by: Troll
Hi, This is related to my previous post but I made it much simpler... open (INFILE, "test.txt"); while (<>) { print $_; s/one/two/g; print $_; }
1
6,491
thread by: Ashley Harris | last post Jul 19 '05 by: Wiseguy
I hope to have a Linux box sitting in the boot of my car using perl and some CPAN modules for Ogg-Vorbis and Audio Streaming for a home-built stereo system. I recently scored a GPS locater that plugs into a USB port, and this. The old PC doesn't have a usb card in it, not a big deal, I'd pay a few bucks for it, but I can't seem to find a USB...
4
2,201
thread by: Bfons | last post Jul 19 '05 by: Bfons
Hello all, I am trying to write a script (without much luck) that will modify certain lines in a sendmail file. Here is what is in the file: SMailerToTriple=95 R< > $* $@ $1 strip off null relay R< error : $-.$-.$- : $+ > $* $#error $@ $1.$2.$3 $: $4 R< error : $- : $+ > $* $#error $@...
0
2,588
thread by: David | last post Jul 19 '05 by: David
I've installed the DBD::Proxy and RPC::PLServer modules on Windows 2000 accessing SQL Server 2000 (through an ODBC system DSN). I can interface to the database from one or more Linux boxes just fine, with the exception that the server is single threaded (i.e., when submitting a query from one script on the same or different clients,...
0
1,397
thread by: Erik Stoy | last post Jul 19 '05 by: Erik Stoy
I would like to do something similar to Python's "import <module> as <name>". This way if I want to use another module that offers the same subroutines I only have to change my "use" statement and not the every line of the form "&Module::Sub()". Can I do this? Or, is there perhaps another, better way of achieving the same kind of...
0
1,372
thread by: Kermit Lowry | last post Jul 19 '05 by: Kermit Lowry
The following code produces fine result when everything is hard wired but replaces '.' and ',' with there octal counterparts when the variables are passed to it. Can't figure out why. I would appreciate if anyone could shed some light to the darkness. ex. hard wired kermit.lowry,food Passed variables
6
6,228
thread by: Troll | last post Jul 19 '05 by: Kris Wempa
Hi, This is what I have: #!/usr/bin/perl -w use strict; sub replace { s/one/two/; }
2
16,749
thread by: John | last post Jul 19 '05 by: John
Sorry, but how does one move up a directory ? I'm in a directory from which I called a script. Part of the script functionality is checking the permissions of the directory I am in. I may need to change the directory permissions depending on what they are. Hence, I need to be able to move up one level of the directory tree. chdir?...
1
1,464
thread by: Leor Zolman | last post Jul 19 '05 by: Leor Zolman
I'm probably going to feel really stupid when I see the answer, but I'm now stuck nevertheless... I need to match a leading literal '*', and Perl isn't getting the idea. Reading from standard input, typing "const" into the program below yields "just const" as expected, but typing "*const" ALSO results in it just saying "just const", rather...
0
2,046
thread by: Reto Zingg | last post Jul 19 '05 by: Reto Zingg
Hi I have here a strange Problem, I monitor with a script our hosting enviroment, so far my script works very well, but unfortunately some of our costumers change to an other HSP :-( and sometimes, we still have them in our database. So that they also appears in my list with domainnames which i check. The problem now is that some of them...
2
5,330
thread by: Matt Taylor | last post Jul 19 '05 by: John Bokma
I have this piece of code: $/ = ' '; $test = "abc "; chomp $test; print $test; which prints spaces at the end of the line. Shouldn't chomp strip the spaces off the end of my scalar $test?
0
3,909
thread by: Sucpraran | last post Jul 19 '05 by: Sucpraran
We are using Cookies in our application to track user session. It works 95% but fails in occations. We could not find any pattern for this. Below is the code to Set and Get cookies. In the occations when it fails, we get nothing in getCookie as if cookie is not set. We verified Browswer Setting and all of them accept cookies. We try to find a...
1
4,110
thread by: Joe | last post Jul 19 '05 by: Thomas Kratz
I am trying to read the EventLog of different servers on the network. If I run the script in a command line, it works well. But when I try to put the script into the Web server (IIS in Windows 2000) and run from a web browser, it works with my local machine only. I have the following error when I try to access any remote server: CGI...
3
6,533
thread by: dpackwood | last post Jul 19 '05 by: Dale
Hello, I have two different scripts that do pretty much the same thing. The main perl script is on Windows. It runs and in the middle of it, it then calls out another perl script that then should run on a Unix box I have. Both scripts run ok, except for the part when Windows try's to call out the Unix script. I have it set up where the Unix...
13
6,404
thread by: NNTP | last post Jul 19 '05 by: Alan Connor
I have a script that outputs the following. 200 23.131.155.5; 1 23.131.161.4; 2 102.131.161.54; 2 23.160.180.4; 35 54.1.8.7; 356 15.18.235.52; 1 205.18.235.88; 1 205.18.246.21;
0
1,520
thread by: Jeff Nokes | last post Jul 19 '05 by: Jeff Nokes
Hello, I'm using Cache::SharedMemoryCache with an Apache 1.3.28 / mod_perl 1.28 / Mason instance on RedHat Linux 7.2. The caching mechanism seems to work fine, it creates one shared memory segment and one semophore when in use. What I noticed was that when I gracefully shut apache down (completely), the segment and semaphore remain. I...
0
3,765
thread by: Matt Ittigson | last post Jul 19 '05 by: Matt Ittigson
I'm getting the following error(s) running perlcc and can't find any explanation or work around. I'm including the errors and the script itself. I get the same errors on a cygwin+Win2k box as a debian box (with perl 5.8). Thanks. File: ---------------------------------- #!/usr/bin/perl use PDF::API2;
1
9,577
thread by: Joe | last post Jul 19 '05 by: Jim Gibson
I am trying to write a Perlscript to be used with some HTML pages. Here is how it works: 1.. The first HTML page has a form which requests for user input. Then it passes the QUERY_STRING to a Perl script. 2.. The Perl script will then validate the data. If input validation fails, it returns to the previous screen and asks the user to...
1
761
thread by: rdimayuga | last post Jul 19 '05 by: Eric J. Roode
I need a regex pattern that will match a string starting with zero or one dot's. For example, ".string" and "string" should both match, but something like "estring" should not match. So far, I've tried the following: \.*string {0,1}string {0,1}string {0,1}string
6
4,780
thread by: Ravi | last post Jul 19 '05 by: Kris Wempa
Hi All, I am trying to execute a select statement using the DBI module of perl in a for loop. I am getting a strange behaviour, the select statement is excuting correctly only for the last element in the for loop. I am including the portion of the code : #Get the connection to the database my $dbh = &getConnection(); my @acodes;
5
1,669
thread by: Jim Rendant | last post Jul 19 '05 by: m
I am having a problem with programming in perl using paths to style sheets and other static pages. I need a little clarification My scenario root directory | - /var/www html directory | - /html FULL PATH - /var/www/html images dir | - /images - /var/www/html/images cgi-bin dir ...
2
12,803
thread by: SL_McManus | last post Jul 19 '05 by: David Trudgett
Hi All; I am fairly new to Perl. I have a file with close to 3000 lines that I would like to split out in a certain way. I would like to put the record type starting in column 1 for 2 spaces, the employer code in column 23 for 29 spaces and employer description in column 53 for 30 spaces. I have tried modifying an existing file with no real...
1
3,164
thread by: Carlo Filippini | last post Jul 19 '05 by: nobull
Hi how can I tie a file handle to a variable (probably tie is not the right perl terminology in this case)? Basically I want that everything that is written to a file is copied into a variable as well. Of course I could read the file again, something like while (<FH>){ .... }

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.