in reply to regular expression to get the tablename.column_name

I was able to do this with and and or but it wouldn't permit using && or ||. It complained Can't modify logical and (&&) in scalar assignment at -e line 1, at EOF. I don't understand this.

perl -F/;/ -lane "/TABLE;(.+)/ and $t=$1 or print qq($t.$F[1])" o33.tx +t
Chris Update: Thanks for the explanation ikegami.

Replies are listed 'Best First'.
Re^2: regular expression to get the tablename.column_name
by ikegami (Patriarch) on Oct 18, 2006 at 04:11 UTC
Re^2: regular expression to get the tablename.column_name
by greatshots (Pilgrim) on Oct 18, 2006 at 04:08 UTC

    perl -F/;/ -lane "/TABLE;(.+)/ and $t=$1 or print qq($t.$F[1])" o33.tx +t
    Oops !! still I did not get the prompt. keeps on running

      Unlike the OP's version, your version won't handle blank lines or lines other than TABLE and COLUMN properly. If that's acceptable, then the following is even shorter:
      perl -nle "/TABLE;(.*)/?($t=$1):/;(.*);/&&print qq($t.$1)" o33.txt