in reply to Finding unique vals from a inout file
Your code slurps the whole file into the first element of @Deploy. Probably not what you wanted.
EDIT: As jethro= points out the original code works. So the following code is no more correct than the OP.
Here, this works:
Outputs two elements as I think you wanted.Troll [113] as maint ~/ %cat foobar + [DING!] #!/usr/bin/perl @Deploy = split "\n",<DATA>; chomp(@Deploy); my @tmp = @Deploy; my %saw = (); foreach my $view_name (@Deploy) { print "view name is $view_name \n"; push (@Deploy1, $view_name) unless $saw{$view_name}++; } print join("\n",@Deploy1); __DATA__ t\test1\WEB\TEST/Admin*V:/test_viewINT/test_CVOB/test_src/Admin/AdminM +enu.asp" \\test\test1\WEB\TEST/Admin*V:/test_viewINT/test_CVOB/test_src/Admin/a +dminUser.asp" \\test\test1\WEB\TEST/Admin*V:/test_viewINT/test_CVOB/test_src/Admin/A +dminMenu.asp" \\test\test1\WEB\TEST/Admin*V:/test_viewINT/test_CVOB/test_src/Admin/a +dminUser.asp"
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Finding unique vals from a inout file
by jethro (Monsignor) on Jun 30, 2008 at 18:45 UTC | |
by starbolin (Hermit) on Jun 30, 2008 at 22:28 UTC |