Sponsored Content
Top Forums Shell Programming and Scripting Use of uninitialized value in join or string at arraydef.pl Post 302134316 by praveen_b744 on Thursday 30th of August 2007 09:40:24 AM
Old 08-30-2007
Question Use of uninitialized value in join or string at arraydef.pl

When try to execute the following script, its throwing this error:
" Use of uninitialized value in join or string at arraydef.pl line 17. "


The script is [ i am pasting with line numbers]:


1 #!/usr/bin/perl
2
3 use strict;
4
5 my @a = ( 1...10 );
6
7 print " Original array : @a \n ";
8
9 #DELETE Function
10
11 my $size=@a;
12
13 print "size of arry before deleting 1st element : $size \n ";
14
15
16 delete($a[0]); #Deleting 1st element
17 print " Array after deleting first element : @a \n ";
18 $size=@a;
19 print "size of arry after deleting 1st element : $size \n "; # size dont differ wen we delete 1st or middle ,,. It differs only wen we delete last element.
20
21 delete($a[$size-1]);
22 print " Array after deleting last element : @a \n ";
23 $size=@a;
24 print "size of arry after deleting last element : $size \n ";
 

10 More Discussions You Might Find Interesting

1. Programming

bss(uninitialized data) segment allocation

Hi 1) Please go through the following code : char string2; char string1; main() { memcpy(string2,"SENDER ",12); strcpy(string1,"******"); printf("%s\n%s\n",string1,string2); } 2) and the output of... (7 Replies)
Discussion started by: karimulla_sha
7 Replies

2. Solaris

How to clear STATE - uninitialized in solaris 10

Helloo Frd's, How to clear uninitialized state in solaris 10 Services, the fallowing inetadm shows on my server. I tried svcadm clear, enable... not worked. And also i can't change to enable some of service on that. sara4@root# inetadm ENABLED STATE FMRI disabled ... (6 Replies)
Discussion started by: madhu548
6 Replies

3. UNIX for Dummies Questions & Answers

Join 2 files with multiple columns: awk/grep/join?

Hello, My apologies if this has been posted elsewhere, I have had a look at several threads but I am still confused how to use these functions. I have two files, each with 5 columns: File A: (tab-delimited) PDB CHAIN Start End Fragment 1avq A 171 176 awyfan 1avq A 172 177 wyfany 1c7k A 2 7... (3 Replies)
Discussion started by: InfoSeeker
3 Replies

4. Shell Programming and Scripting

use of uninitialized value in subtraction

Hallo all i am trying to execute this script ............... But this is throwing the error...... use of uninitialized value in subtraction in at icd_convert.pl line 156 use of uninitialized value in subtraction in at icd_convert.pl line 157 use of uninitialized value in subtraction in at... (1 Reply)
Discussion started by: suvenduperl
1 Replies

5. Shell Programming and Scripting

Join lines with the same start string

I have the text like: DN11-001 Thats the first line which needs to be DN11-001 joined with the second line and also to DN11-001 the third line as they all begin with the same DN11-001 document number. DN11-002 The number of lines differ DN11-002 among the documents. DN11-005 It can also be... (10 Replies)
Discussion started by: andrejm
10 Replies

6. UNIX for Dummies Questions & Answers

Join On A String

Is is possible to join on unsorted files by a string? Don't want to sort because there is other text that is already in a good format. File1 has this text string: ABCD-123 FGH File2 has this text string: ABCD-123 I want to replace or join ABCD-123 in file 2 with ABCD-123 FGH in file... (11 Replies)
Discussion started by: jimmyf
11 Replies

7. UNIX for Dummies Questions & Answers

awk - How to join the string with values

Hi, I'm a beginner in awk script. I've been trying to figure how to concatenate two string in input file using awk after the value is calculated. I'm trying to get this format Apple 5.2(10) Orange 4.4(8) Watermelon 3.10(30) Berries 10.2(20) The input file with the format fruit... (2 Replies)
Discussion started by: KCApple
2 Replies

8. Solaris

Telnet uninitialized

HI I need help regarding telnet as I try to run the service it gives error #svcs -xv svc:/network/telnet:default svc:/network/telnet:default (Telnet server) State: uninitialized since Wed May 15 16:46:41 2013 Reason: Restarter svc:/network/inetd:default is not running. See:... (14 Replies)
Discussion started by: smazshah
14 Replies

9. Shell Programming and Scripting

PERL - Use of uninitialized value in pattern match (m//)

I have written a PERL script to read files from directory that the filename contains OT. It then takes each line of each file and prints the first 5 characters before the first occurence of a /. Currently I am getting the error: Use of uninitialized value in string at rowGrab.pl line 43.... (3 Replies)
Discussion started by: chris01010
3 Replies

10. Solaris

Lot of services in non-global zones, in uninitialized after reboot

Hello, This is Solaris-10 server, running with 4 non-global zones. This server was hung today and I had to reboot it forcefully from console. Then root file-system was not clean and I had to run fsck from failsafe mode. After it came back in run-level-3, lot of services are showing in... (3 Replies)
Discussion started by: solaris_1977
3 Replies
Validation::Class::Errors(3pm)				User Contributed Perl Documentation			    Validation::Class::Errors(3pm)

NAME
Validation::Class::Errors - Error Handling Object for Fields and Classes VERSION
version 7.70 SYNOPSIS
package SomeClass; use Validation::Class; package main; my $class = SomeClass->new; ... # errors at the class-level my $errors = $class->errors ; print $errors->to_string; # errors at the field-level my $field_errors = $user->fields->{name}->{errors} ; print $field_errors->to_string; 1; DESCRIPTION
Validation::Class::Errors is responsible for error handling in Validation::Class derived classes on both the class and field levels respectively. METHODS
new my $self = Validation::Class::Errors->new; add $self = $self->add("houston, we have a problem", "this isn't cool"); all my @list = $self->all; clear $self = $self->clear; count my $count = $self->count; each my $list = $self->each(sub{ ucfirst lc shift }); list my $list = $self->list; find my @matches = $self->find(qr/password/); first my $item = $self->first; my $item = $self->first(qr/password/); join my $string = $self->join; # returns "an error, another error" my $string = $self->join($delimiter); to_string The to_string method stringifies the errors using the specified delimiter or ", " (comma-space) by default. my $string = $self->to_string; # returns "an error, another error" my $string = $self->to_string($delimiter, sub { ucfirst lc shift }); AUTHOR
Al Newkirk <anewkirk@ana.io> COPYRIGHT AND LICENSE
This software is copyright (c) 2011 by Al Newkirk. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. perl v5.14.2 2012-06-28 Validation::Class::Errors(3pm)
All times are GMT -4. The time now is 04:10 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy