in reply to Re: I don't understand why I'm getting an "Use of uninitialized value" error
in thread I don't understand why I'm getting an "Use of uninitialized value" error

So how does one maintain the integrity of the backslashes? I am not sure what you mean. Abbreviated Script:

#!/usr/bin/perl -w use warnings; use strict; my @search = ("/<ID>(.*?)<\/ID>/", # ID "/<TimeStamp>(.*?)<\/TimeStamp>/", # Time Stamp "/<IP_Address>(.*?)<\/IP_Address>/", # IP Address "/<Title>(.*?)<\/Title>/", # Title "/<Complainant><Entity>(.*?)<\/Entity>/", # Reporting Ent +ity "/<Contact>(.*?)<\/Contact>/", # Reporting Entity Con +tact "/<Address>(.*?)<\/Address>/", # Reporting Entity Add +ress "/<\/Phone><Email>(.*?)<\/Email>/"); # Reporting Entity E +mail Address print @search;
dpich@m6400-vb:~/Documents$ perl 2time.pl /<ID>(.*?)</ID>//<TimeStamp>(.*?)</TimeStamp>//<IP_Address>(.*?)</IP_A +ddress>//<Title>(.*?)</Title>//<Complainant><Entity>(.*?)</Entity>//< +Contact>(.*?)</Contact>//<Address>(.*?)</Address>//</Phone><Email>(.* +?)</Email>/dpich@m6400-vb:~/Documents$

Replies are listed 'Best First'.
Re^3: I don't understand why I'm getting an "Use of uninitialized value" error
by jwkrahn (Abbot) on Nov 03, 2011 at 18:44 UTC

    This should work:

    my @search = ( qr[<ID>(.*?)</ID>], # ID qr[<TimeStamp>(.*?)</TimeStamp>], # Time Stamp qr[<IP_Address>(.*?)</IP_Address>], # IP Address qr[<Title>(.*?)</Title>], # Title qr[<Complainant><Entity>(.*?)</Entity>], # Reporting Enti +ty qr[<Contact>(.*?)</Contact>], # Reporting Entity Cont +act qr[<Address>(.*?)</Address>], # Reporting Entity Addr +ess qr[</Phone><Email>(.*?)</Email>], # Reporting Entity Emai +l Address );