The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
awk Shell Script error : "Syntax Error : `Split' unexpected Herry UNIX for Dummies Questions & Answers 2 03-17-2008 11:16 AM
error during run: St9bad_alloc - Getting this error while using some conversion progr sathu_pec Shell Programming and Scripting 1 01-21-2008 02:38 AM
I got error like...syntax error on line 1, teletype koti_rama UNIX for Advanced & Expert Users 2 07-07-2007 07:35 PM
error reading sections error at install doelman SUN Solaris 2 02-05-2007 12:21 PM
Error: Internal system error: Unable to initialize standard output file firkus UNIX for Dummies Questions & Answers 2 10-25-2005 03:23 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 07-17-2008
looza looza is offline
Registered User
  
 

Join Date: Jun 2008
Posts: 23
Question Error!

#!/usr/local/bin/perl -w


system "ls -iR del-dir > temp";

# Check if entry in hash. If yes, store filename in array

open(INO_FNAME, "temp")|| die "File doesnt exist!" ;
open(FNAMES, ">>filenames") || die "File doesnt exist!" ;
while($record = <INO_FNAME>){
# print $record;
if($record=~ m/:/){
$dir = $record ;
# print "here", $dir, "d \n";
chop $dir;
chop $dir;
}
# print "here", $dir, "dir \n";
($inode,$fname) = split (' ', $record);
if ( exists $FID_DBN_HT{$inode}) {
@file_name = $dir . $fname;
print (FNAMES $dir . $fname, "\n");
print ($inode, "\t fname", $dir . "/" . $fname, "\n");
}
}

close(INO_FNAME);
close(FNAMES);
$end = time;

--------------------
With this I get:
Use of uninitialized value in concatenation (.) or string at temp.pl line 21, <INO_FNAME> line 8.
Use of uninitialized value in concatenation (.) or string at temp.pl line 22, <INO_FNAME> line 8.

Any idea why?
Thanks!
  #2 (permalink)  
Old 07-17-2008
KevinADC KevinADC is offline Forum Advisor  
Registered User
  
 

Join Date: Jan 2008
Posts: 731
Those are warnings, not errors. This line in your code should just be removed:

@file_name = $dir . $fname;

it appears to not be doing anything and its not the correct way to assign values to an array anway. Do this to try and track down the missing scalar value:

Code:
($inode,$fname) = split (' ', $record);
print "[$inode] - [$fname]\n";

I think one or both of those scalars is not getting defined. The [] are to let you know if they are blank.

Or you could just drop the -w switch on the shebang line and the warnings will not be output.
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 04:08 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0