Sponsored Content
Top Forums Shell Programming and Scripting Perl Script Issue - Please Help * Thanks!!! Post 302253889 by summer_cherry on Monday 3rd of November 2008 02:47:02 AM
Old 11-03-2008
Code:
use strict;
my @files=glob("*.nsb");
foreach my $key (@files){
        open FH,$key or die "Can not open $_";
        while(<FH>){
                my @tmp=split(",",$_);
                print $tmp[2] if ($_=~/pat/);
        }
        close FH;
}

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

perl issue ..

hi one perl issue i have xml file with 2 values and one condition b.w them <rule> <val1>12</val1> <cond>and</cond> <val2>13</val2> </rule> i read these values in hash in perl code $one{val1} = 12 $one{cond} = and $one{val2} = 13 now i want to form... (3 Replies)
Discussion started by: zedex
3 Replies

2. Shell Programming and Scripting

Perl Issue

Hi, I got this script from the web, this generates an LDAP report in CSV format. #!/usr/bin/perl # # Copyright (c) 2004 # Ali Onur Cinar &060;cinar&064;zdo.com&062; # # License: # # Permission to use, copy, modify, and distribute this software and its # documentation for... (23 Replies)
Discussion started by: raj001
23 Replies

3. Shell Programming and Scripting

Perl Script issue. What am I doing wrong?

#!/usr/local/bin/perl open (MYFILE, 'logs_report'); while (<MYFILE>) { $rec=$_; chomp ($rec); @arr=split(/ /,$rec); print $rec,"\n" if ($arr!~/OK/); open (MYF, '>data.txt'); print $rec,"\n" if ($arr!~/OK/); close (MYF); (14 Replies)
Discussion started by: SkySmart
14 Replies

4. Shell Programming and Scripting

Perl issue - please help!

Hello. I've been writing some code in Perl to read in strings from html files and have been having issues. In the html file, each "paragraph" is a certain file on the website. I need to find every one of the files that is a certain type, in this case, having green color....therefore... (7 Replies)
Discussion started by: akreibich07
7 Replies

5. Shell Programming and Scripting

Perl script issue: print

Can someone tell me what I'm doing wrong with my perl script? I am new to Perl. This isn't even the final script, I'm just testing to see if it will print the directories with the files in it. For some reason my output is only printing the 1st, 6th, and last entries of the @sub_dir array. Each... (3 Replies)
Discussion started by: man
3 Replies

6. Web Development

Accessing a Perl CGI script, security issue

Hi Everybody, I was wondering if it was possible for someone to gain access to my Perl CGI scripts before they are interpreted by Perl (mod_perl on apache2) i.e. getting a hold of my raw scripts and not the html output? Let's say I use the DBI module where I have the hostname, user and... (2 Replies)
Discussion started by: z1dane
2 Replies

7. Shell Programming and Scripting

Perl script issue

Hi All, I have a perl script which I am using in Windows environment. There is one more file called "functions.txt" which is having all the functions defined to used in my perl script. And the path for this function file is defined in my perl script. Howeever sometimes I am getting below error... (4 Replies)
Discussion started by: gr8_usk
4 Replies

8. Shell Programming and Scripting

Issue regarding dos2unix perl script

Hi All, I have pearl script which will check and convert the file: INFO("dos2unix_cmds".$#{$dos2unix_cmds}); if ( $#{$dos2unix_cmds} == 0 ) { my $convert_cmd = $$dos2unix_cmds; my $rename_cmd = $$dos2unix_cmds; --conversion going here else INFO ("No need to... (8 Replies)
Discussion started by: saps19
8 Replies

9. Shell Programming and Scripting

Perl : embedding java script with cgi perl script

Hi All, I am aware that html tags can be embedded in cgi script as below.. In the same way is it possible to embed the below javascript in perl cgi script ?? print("<form action="action.htm" method="post" onSubmit="return submitForm(this.Submitbutton)">"); print("<input type = "text"... (1 Reply)
Discussion started by: scriptscript
1 Replies

10. Programming

PERL: In a perl-scripttTrying to execute another perl-script that SETS SOME VARIABLES !

I have reviewed many examples on-line about running another process (either PERL or shell command or a program), but do not find any usefull for my needs way. (Reviewed and not useful the system(), 'back ticks', exec() and open()) I would like to run another PERL-script from first one, not... (1 Reply)
Discussion started by: alex_5161
1 Replies
SHM_ATTACH(3)								 1							     SHM_ATTACH(3)

shm_attach - Creates or open a shared memory segment

SYNOPSIS
resource shm_attach (int $key, [int $memsize], [int $perm = 0666]) DESCRIPTION
shm_attach(3) returns an id that can be used to access the System V shared memory with the given $key, the first call creates the shared memory segment with $memsize and the optional perm-bits $perm. A second call to shm_attach(3) for the same $key will return a different shared memory identifier, but both identifiers access the same underlying shared memory. $memsize and $perm will be ignored. PARAMETERS
o $key - A numeric shared memory segment ID o $memsize - The memory size. If not provided, default to the sysvshm.init_mem in the php.ini, otherwise 10000 bytes. o $perm - The optional permission bits. Default to 0666. RETURN VALUES
Returns a shared memory segment identifier. CHANGELOG
+--------+---------------------------------------------------+ |Version | | | | | | | Description | | | | +--------+---------------------------------------------------+ | 5.3.0 | | | | | | | This function now returns a resource instead of | | | an integer. | | | | +--------+---------------------------------------------------+ NOTES
Note This function used to return an integer value prior to PHP 5.3.0. To achieve the same value in a portable manner, the return value can be cast to an integer like: Example #1 <?php // Create a temporary file and return its path $tmp = tempnam('/tmp', 'PHP'); // Get the file token key $key = ftok($tmp, 'a'); // Attach the SHM resource, notice the cast afterwards $id = shm_attach($key); if ($id === false) { die('Unable to create the shared memory segment'); } // Cast to integer, since prior to PHP 5.3.0 the resource id // is returned which can be exposed when casting a resource // to an integer $id = (integer) $id; ?> SEE ALSO
shm_detach(3), ftok(3). PHP Documentation Group SHM_ATTACH(3)
All times are GMT -4. The time now is 07:02 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy