Sponsored Content
Top Forums Shell Programming and Scripting Perl - Sort and Count foreach line Post 302518247 by sureshcisco on Friday 29th of April 2011 03:16:48 AM
Old 04-29-2011
Updated
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Nested foreach in perl

I have two arrays @nextArray contains some files like \main\1\Xul.xml@@\main\galileo_integration_sjc\0 \main\1\PortToStorageDialog.xml@@\main\galileo_integration_sjc\0 . . . \main\1\PreferencesDialog.xml@@\main\galileo_integration_sjc\0 @otherArray contains some files like ... (2 Replies)
Discussion started by: nmattam
2 Replies

2. Shell Programming and Scripting

Perl line count if it matches a pattern

#!/usr/bin/perl use Shell; open THEFILE, "C:\galileo_integration.txt" || die "Couldnt open the file!"; @wholeThing = <THEFILE>; close THEFILE; foreach $line (@wholeThing){ if ($line =~ m/\\0$/){ @nextThing = $line; if ($line =~ s/\\0/\\LATEST/g){ @otherThing =... (2 Replies)
Discussion started by: nmattam
2 Replies

3. Shell Programming and Scripting

How to count using foreach

I have a simple csh script that has a simple foreach loop that goes over numbers, from 1 to 10: foreach n(1 2 3 4 5 6 7 8 9 10) ... end Now I want to expand the script to work on over a hundred consecutive n values. Obviously, typing all the numbers between 1 to 100 is an unreasonable... (7 Replies)
Discussion started by: mcbenus
7 Replies

4. Programming

PERL, search and replace inside foreach loop

Hello All, Im a Hardware engineer, I have written this script to automate my job. I got stuck in the following location. CODE: .. .. ... foreach $key(keys %arr_hash) { my ($loc,$ind,$add) = split /,/, $arr_hash{$key}; &create_verilog($key, $loc, $ind ,$add); } sub create_verilog{... (2 Replies)
Discussion started by: riyasnr007
2 Replies

5. Shell Programming and Scripting

awk: sort lines by count of a character or string in a line

I want to sort lines by how many times a string occurs in each line (the most times first). I know how to do this in two passes (add a count field in the first pass then sort on it in the second pass). However, can it be done more optimally with a single AWK command? My AWK has improved... (11 Replies)
Discussion started by: Michael Stora
11 Replies

6. Shell Programming and Scripting

PERL foreach & open not working together

My script is as below: my $tile_list = `egrep "FCFP_TILE_LIST.*=" ${BudgetDir}/tile.params | sed -e 's/FCFP_TILE_LIST//' | sed -e 's/=//'`; print "Tile List = ".$tile_list."\n"; my @tiles = split(/\s+/, $tile_list); $unconst_out = "${DestDir}/Unconstrained_ports.rpt"; $check_tim_out =... (2 Replies)
Discussion started by: kuchi7
2 Replies

7. Shell Programming and Scripting

Need perl or shell script to sort vertical lines to horizontal line in csv format

Need perl or shell script to sort vertical lines to horizontal line in csv format My file like below ------------------------- ================================================================================ PATH PINKY1000#I1-1-ZENTA1000-2#I7-1-ASON-SBR-UP-943113845 ... (4 Replies)
Discussion started by: sreedhargouda.h
4 Replies

8. Shell Programming and Scripting

Perl - line count of a file

Hi, I am quite new to perl scripting. I have a dat file (datFile) from which I am pulling only first column and saving the output to a new file (f). From that file (f) I am removing blank lines and saving it to new file (datFile1). I am able to get the count of $f file in variable $cnt. But... (4 Replies)
Discussion started by: Neethu
4 Replies

9. UNIX for Advanced & Expert Users

Sort words based on word count on each line

Hi Folks :) I have a .txt file with thousands of words. I'm trying to sort the lines in order based on number of words per line. Example from: word word word word word word word word word word word word word word word word to desired output: word (2 Replies)
Discussion started by: martinsmith
2 Replies

10. Shell Programming and Scripting

Print perl hash value in foreach loop

Experts - Any advice on how to get a hash value in a foreach loop? Values print correctly on standalone print statements, but I can't access value in foreach loop. See sample code below and thanks in advance. foreach my $z (sort keys %hash) { for $y (@{$hash{$z}}) { print "$z... (6 Replies)
Discussion started by: timj123
6 Replies
PERL5130DELTA(1)					 Perl Programmers Reference Guide					  PERL5130DELTA(1)

NAME
perl5130delta - what is new for perl v5.13.0 DESCRIPTION
This document describes differences between the 5.12.0 release and the 5.13.0 release. If you are upgrading from an earlier release such as 5.10.0, first read perl5120delta, which describes differences between 5.10.0 and 5.12.0. Core Enhancements "safe signals" optimization Signal dispatch has been moved from the runloop into control ops. This should give a few percent speed increase, and eliminates almost all of the speed penalty caused by the introduction of "safe signals" in 5.8.0. Signals should still be dispatched within the same statement as they were previously - if this is not the case, or it is possible to create uninterruptible loops, this is a bug, and reports are encouraged of how to recreate such issues. Assignment to $0 sets the legacy process name with "prctl()" on Linux On Linux the legacy process name will be set with prctl(2), in addition to altering the POSIX name via "argv[0]" as perl has done since version 4.000. Now system utilities that read the legacy process name such as ps, top and killall will recognize the name you set when assigning to $0. The string you supply will be cut off at 16 bytes, this is a limitation imposed by Linux. Optimization of shift; and pop; calls without arguments Additional two OPs are not added anymore into op tree for shift and pop calls without argument (when it works on @_). Makes "shift;" 5% faster over "shift @_;" on not threaded perl and 25% faster on threaded. Modules and Pragmata Updated Modules CGI Updated to version 3.49. Data::Dumper Updated to version 2.126. MIME::Base64 Updated to 3.09. threads Updated to version 1.77 threads-shared Updated to version 1.33 Installation and Configuration Improvements Platform Specific Changes AIX Allow building on AIX 4.2. Acknowledgements Perl 5.13.0 represents eight days of development since Perl 5.12.0 and contains 3,766 lines of changes across 151 files from 29 authors and committers. Thank you to the following for contributing to this release: AEvar Arnfjoer` Bjarmason, Alex Vandiver, Chris Williams, chromatic, Craig A. Berry, David Golden, David Mitchell, Eric Brine, Father Chrysostomos, Florian Ragwitz, Frank Wiegand, Gisle Aas, H.Merijn Brand, Hugo van der Sanden, Jesse Vincent, Josh ben Jore, Karl Williamson, Leon Brocard, Michael G Schwern, Michael G. Schwern, Nga Tang Chan, Nicholas Clark, Niko Tyni, Rafael Garcia-Suarez, Ricardo Signes, Robin Barker, Slaven Rezic, Steffen Mueller, Zefram. Reporting Bugs If you find what you think is a bug, you might check the articles recently posted to the comp.lang.perl.misc newsgroup and the perl bug database at http://rt.perl.org/perlbug/ . There may also be information at http://www.perl.org/ , the Perl Home Page. If you believe you have an unreported bug, please run the perlbug program included with your release. Be sure to trim your bug down to a tiny but sufficient test case. Your bug report, along with the output of "perl -V", will be sent off to perlbug@perl.org to be analysed by the Perl porting team. If the bug you are reporting has security implications, which make it inappropriate to send to a publicly archived mailing list, then please send it to perl5-security-report@perl.org. This points to a closed subscription unarchived mailing list, which includes all the core committers, who be able to help assess the impact of issues, figure out a resolution, and help co-ordinate the release of patches to mitigate or fix the problem across all platforms on which Perl is supported. Please only use this address for security issues in the Perl core, not for modules independently distributed on CPAN. SEE ALSO
The Changes file for an explanation of how to view exhaustive details on what changed. The INSTALL file for how to build Perl. The README file for general stuff. The Artistic and Copying files for copyright information. perl v5.14.2 2011-09-26 PERL5130DELTA(1)
All times are GMT -4. The time now is 05:33 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy