perl

Monitor socket with ngrep or perl for activity, then issue command

I'd like to use ngrep and/or perl to monitor the incoming data stream on a socket, then, when the appropriate characters arrive, like in this case, the string "192.168.1.101:8080", input to the data stream a redirect to another ipaddress, such as "192.168.1.102" Is this even possible? ...

How do i make a "system call to tar files(along with exclude tag)" to work in Perl

This is the system call, i am making right now in perl to tar the files system("${tarexe} -pcvf $tarname $includepath") which works fine. $tarexe -> location of my tar.exe file $tarname -> myMock.tar $includepath -> ./input/myMockPacketName ./input/myPacket/my2/*.wav ./input/myPacket/my3 ./input/myPacket/in.html Now i want to exclu...

Ignoring Whitespace with Regex(perl)

Hello, I am using Perl Regular expressions. How would i go about ignoring white space and still perform a test to see if a string match. For example. $var = " hello "; #I want var to igonore whitespace and still match if($var =~ m/hello/) { } ...

Matching a date in perl

Hello, I want to match a date in the format day/month/year. where day is two digits month is two digits and year is four digits. Also, I want to check see if it is a valid date, for example knows when is leap year, and know which month has 30days, 31days and 28, or 29 days for Februrary. ...

How To Avoid a Perl script calling an Another Perl Script

Hello, i am calling a perl script client.pl from a main script to capture the output of client.pl in @output. is there anyway to avoid the use of these two files so i can use the output of client.pl in main.pl itself here is my code.... main.pl ======= my @output = readpipe("client.pl"); client.pl ========= #! /usr/bin/perl -w #u...

Perl SDL Windows Installation

I'm using Windows and I need the SDL Library to start using SDL with Perl. I've been pointed to http://www.libsdl.org/ to download it. My first queston is, which library do I want from that page? There's 3 to choose from... Then I've been pointed to 4 other SDL extensions by this page: http://arstechnica.com/gaming/news/2006/02/games-pe...

How can I parse this configuration file format (allowing comments) in Perl?

I am reading some parameters (from user input) from a .txt file and want to make sure that my script could read it even a space or tab is left before that particular parameter by user. Also if I want to add a comment for each parameter followed by # , after the parameter (e.g 7870 # this is default port number) to let the user know abo...

Setting up a common perl/cpan environment

Hi, so I'm having a lot of fun with Perl at home for some time now. How much more difficult do things get when you develop Perl modules (In my case it's mostly catalyst) in a team? How do we make sure we all got the same development environment (Perl/Module versions)? Simply by keeping up to date with CPAN? Do some teams setup their 'pr...

Perl Cron Scheduler: start at x time, execute every y minutes forever

I'm using perl cron, and I want to make a rule like this run every xx min/hours starting at yy:yy time (until the end of time) How would I put this into a cron string? perl:cron seems to use the same syntax as regular cron so a regular cron string should work TIA! ...

how to get textfield data in win32-gui perl

hi i want to store textfield data in a variable but my code is not working here is my code use Win32::GUI qw<>; my $W1 = Win32::GUI::Window->new( -name => "W1", -title => "First Window", -pos => [ 100, 100 ], -size => [ 300, 200 ], ); $W1->AddButton( -name => "ButtonW1", -text => "Enter Chipname", -pos => [ 87, 100 ], #-...

multiple Perl ` print $cgi->header, <<HTML; .... HTML ` statement gives problem

i have something like: #!/usr/bin/perl use strict; use warnings; use CGI::Simple; use DBI; my $cgi = CGI::Simple->new; if ($cgi->param('selid')) { print $cgi->header, <<HTML; <br/>this is SELECT HTML } elsif ($cgi->param('delid')) { print $cgi->header, <<HTML; <b>this is DELETE</b> HTML } elsif ($cgi...

What is the difference between Perl modules autodie and Fatal?

The Perl modules autodie and Fatal seem to be doing similar things. What are the reasons for using one in preference to the other? ...

Where can I find information about Perl's special variables?

Perl has quite a few special variables such as @F, $!, %! ... etc. Where are all Perl's special variables documented? ...

[Perl] Retrieve the reference

Hello, with the hash below, I would like the clients array's reference : my $this = { 'name' => $name, 'max_clients' => $max_clients, 'clients' => () }; I can't do "\$this{'clients'};" to retrieve the reference. ...

How can I call winrar in perl on windows

Is it possible to call winrar through perl on a windows system, such as perl -e "rar a -rr10 -s c:\backups\backup.rar @backup.lst" If so, is there a more efficient way to do this? I've looked up "perl -e" +winrar on google, however none of the results gave me any answer that was remotely close to what i was looking for. The system Im...

MATLAB - Delete elements of binary files without loading entire file

This may be a stupid question, but Google and MATLAB documentation have failed me. I have a rather large binary file (>10 GB) that I need to open and delete the last forty million bytes or so. Is there a way to do this without reading the entire file to memory in chunks and printing it out to a new file? It took 6 hours to generate the f...

PHP equivalent to Perl format function

Is there an equivalent to Perl's format function in PHP? I have a client that has an old-ass okidata dotmatrix printer, and need a good way to format receipts and bills with this arcane beast. I remember easily doing this in perl with something like: format BILLFORMAT = Name: @>>>>>>>>>>>>>>>>>>>>>> Age: @### $name, ...

Rename a file with perl

I have a file in a different folder I want to rename in perl, I was looking at a solution earlier that showed something like this: #rename for (<C:\\backup\\backup.rar>) { my $file = $_; my $new = $file . 'backup' . $ts . '.rar'; rename $file, $new or die "Error, can not rename $file as $new: $!"; } however backup.rar is...

ASP-style tags for Perl web development?

I feel like I'm traveling 10 years back in time by asking this, but... Are there any modules, patches, or any "new" version of Perl (released in the last 10 years) to enable writing web-oriented Perl scripts using ASP-style tags? e.g. from ASP/JSP some html <% some code %> more HTML e.g. from PHP some html <? some code ?> more...

is there a way to designate the line token delimiter in Perl's file reader?

I'm reading a text file via CGI in, in perl, and noticing that when the file is saved in mac's textEdit the line separator is recognized, but when I upload a CSV that is exported straight from excel, they are not. I'm guessing it's a \n vs. \r issue, but it got me thinking that I don't know how to specify what I would like the line termi...