I have always been happy in libraries, though without ever being entirely at ease there. A scene that seems to crop up regularly in plays that I have written has a character, often a young man, standing in front of a bookcase feeling baffled. He – and occasionally she – is overwhelmed by the amount of stuff that has been written and the ground to be covered. ‘All these books. I’ll never catch up,’ wails the young Joe Orton in the film script of Prick Up Your Ears, and in The Old Country another young man reacts more dramatically, by hurling half the books to the floor. In Me, I’m Afraid of Virginia Woolf someone else gives vent to their frustration with literature by drawing breasts on a photograph of Virginia Woolf and kitting out E.M. Forster with a big cigar. Orton himself notoriously defaced library books before starting to write books himself. This resentment, which was, I suppose, somewhere mine, had to do with feeling shut out. A library, I used to feel, was like a cocktail party with everybody standing with their back to me; I could not find a way in.

The first library I did find my way into was the Armley Public Library in Leeds where a reader’s ticket cost tuppence in 1940; not tuppence a time or even tuppence a year but just tuppence; that was all you ever had to pay. It was rather a distinguished building, put up in 1901, the architect Percy Robinson, and amazingly for Leeds, which is and always has been demolition crazy, it survives and is still used as a library, though whether it will survive the present troubles I don’t like to think.

We would be there as a family, my mother and father, my brother and me, and it would be one of our regular weekly visits. I had learned to read quite early when I was five or six by dint, it seemed to me then, of watching my brother read. We both of us read comics but whereas I was still on picture-based comics like the Dandy and the Beano, my brother, who was three years older, had graduated to the more text-based Hotspur and Wizard. Having finished my Dandy I would lie down on the carpet beside him and gaze at what he was reading, asking him questions about it and generally making a nuisance of myself. Then – and it seemed as instantaneous as this – one day his comic made sense and I could read. I’m sure it must have been more painstaking than this but not much more.

Having learned to read, other than comics, there was nothing in the house on which to practise my newly acquired skill. My parents were both readers and Dad took the periodical John Bull, the books they generally favoured literature of escape, tales of ordinary folk like themselves who had thrown it all up for a life of mild adventure, a smallholding on the Wolds, say, or an island sanctuary, with both of them fans of the naturalist R.M. Lockley. There were a few volumes of self-help in the house but the only non-library book of autobiography was I Haven’t Unpacked by William Holt, who had got away from the dark, satanic mills by buying a horse and riding through England.

The Armley library was at the bottom of Wesley Road, the entrance up a flight of marble steps under open arches, through brass-railed swing doors panelled in stained glass which by 1941 was just beginning to buckle. Ahead was the Adults’ Library, lofty, airy and inviting; to the right was the Junior Library, a low dark room made darker by the books which, regardless of their contents, had been bound in heavy boards of black, brown or maroon embossed with the stamp of Leeds Public Libraries. This grim packaging was discouraging to a small boy who had just begun to read, though more discouraging still was the huge and ill-tempered, walrus-moustached British Legion commissionaire who was permanently installed there. The image of General Hindenburg, who was pictured on the stamps in my brother’s album, he had lost one or other of his limbs in the trenches, but since he seldom moved from his chair and just shouted it was difficult to tell which.

Such veterans of the First War were much in evidence well into the 1950s. As a child one encountered them in parks, sitting on benches and in shelters playing dominoes, generally grumpy and with reason to be, the war having robbed them of their youth and often their health. The luckier and less disabled ones manned lifts or were posted at the doors of public buildings, a uniformed and bemedalled conciergerie who were more often than not unhelpful, making the most of whatever petty authority they were invested with. And so it was here, the commissionaire’s only concern to maintain absolute silence, and not at all the companion and friend novice readers needed on this, the threshold of literature.

Of the books themselves I remember little. Henty was well represented and Captain Marryat, books which whenever I did manage to get into them only brought home to me that I was not an entirely satisfactory version of the genus boy. I suppose there must somewhere have been Enid Blyton, but since she too would have been backed in the same funereal but immensely serviceable boards she passed me by. As it was, the books I best remember reading there were the Dr Dolittle stories of Hugh Lofting, which were well represented and (an important consideration) of which there were always more. I think I knew even at six years old that a doctor who could talk to animals was fiction but at the same time I thought the setting of the stories, Puddleby-on-the-Marsh, was a real place set in historical time with the doctor (and Lofting’s own illustrations of the doctor) having some foundation in fact. Shreds of this belief clung on because when, years later, having recorded some of Lofting’s stories for the BBC, I met his son, I found I still had the feeling that his father had been not quite an ordinary mortal.

Other mysteries persisted. What, for instance, was a cat’s meat man? I had never come across one. Was the meat of cats or for cats? We didn’t have a cat and even if we had with Dad being a Co-op butcher it would have been well catered for. And again it was when I was reading the stories on the radio and happened to mention this mysterious personage in my diary in the LRB that the small mystery was solved. A cat’s meat man toured the streets (though not our street) with strips of meat suspended from a stick to be sold as pet food. One correspondent, her mother being out, remembered the stick of meat being put through the letterbox where she retrieved it from the doormat and, it being wartime, scoffed the lot.

In 1944, believing, as people in Leeds tended to do, that flying bombs or no flying bombs, things were better Down South, Dad threw up his job with the Co-op and we migrated to Guildford. It was a short-lived experiment and I don’t remember ever finding the public library, but this was because a few doors down from the butcher’s shop where Dad worked there was a little private library, costing 6d a week, which in the children’s section had a whole run of Richmal Crompton’s William books. I devoured them, reading practically one a day, happy in the knowledge that there would always be more. Years later when I first read Evelyn Waugh I had the same sense of discovery: here was a trove of books that was going to last. I wish I could say I felt the same about Dickens or Trollope or Proust even, but they seemed more of a labour than a prospect of delight.

The butcher for whom my dad worked also ran a horsemeat business, the meat strictly for non-human consumption and accordingly painted bright green. In his cattle truck Mr Banks would go out into the Surrey countryside to collect carcasses and sometimes, by dint of hanging around the lorry, I got to go with him. I would watch as the bloated cow or horse was winched on board and then we would drive to the slaughterhouse in Walnut Tree Close just by Guildford Station. While the carcass was dismembered I would sit in the corner absorbed in my latest William book. Richmal Crompton can seldom have been read in such grisly and uncongenial circumstances.

It wasn’t long, though, before we ended up going back to Leeds where we now lived in Headingley, with the local public library on North Lane, a visit to which could be combined with seeing the film at the Lounge cinema opposite. I went to Leeds Modern School, a state school at Lawnswood (and now called Lawnswood). I spoke there a few months ago and, unlike Ofsted, was much impressed by it, its current disfavour a presumed punishment for its admirable headmistress, who is still managing to resist the siren charms of academy status and the wiles of Mr Gove. In those circumstances I am happy to boast that the school library has been named after me.

When I was in the sixth form at the Modern School I used to do my homework in the Leeds Central Library in the Headrow. At that time the municipal buildings housed not only the lending library and the reference library but also the education offices and the police department, which I suppose was handy for the courts, still functioning across the road in the town hall with the whole complex – town hall, library, courts – an expression of the confidence of the city and its belief in the value of reading and education, and where you might end up if they were neglected. It’s a High Victorian building done throughout in polished Burmantofts brick, extravagantly tiled, the staircases of polished marble topped with brass rails, and carved at the head of each stair a slavering dog looking as if it’s trying to stop itself sliding backwards down the banister.

Armley Public Library

The reference library itself proclaimed the substance of the city with its solid elbow chairs and long mahogany tables, grooved along the edge to hold a pen, and in the centre of each table a massive pewter inkwell. Arched and galleried and lined from floor to ceiling with books the reference library was grand yet unintimidating. Half the tables were filled with sixth-formers like myself, just doing their homework or studying for a scholarship; but there would also be university students home for the vacation, the Leeds students tending to work up the road in their own Brotherton Library. There were, too, the usual quota of eccentrics that haunt any reading room that is warm and handy and has somewhere to sit down. Old men would doze for hours over a magazine taken from the rack, though if they were caught nodding off an assistant would trip over from the counter and hiss, ‘No sleeping!’

One regular, always with a pile of art books at his elbow, was the painter Jacob Kramer, some of whose paintings, with their Vorticist slant, hung in the art gallery next door. Dirty and half-tight there wasn’t much to distinguish him from the other tramps whiling away their time before trailing along Victoria Street to spend the night in the refuge in the basement of St George’s Church, where occasionally I would do night duty myself, sleeping on a camp bed in a room full of these sad, defeated, utterly unthreatening creatures.

With its mixture of readers and its excellent facilities (it was a first-rate library) and the knowledge that there would always be someone working there whom I knew and who would come out for coffee, I found some of the pleasure going to the reference library that, had I been less studious, I could have found in a pub. Over the next ten years while I still thought I might turn into a medieval historian I became something of a connoisseur of libraries, but the reference library in Leeds always seemed to me one of the most congenial. It was there, on leave from the army, that I discovered they held a run of Horizon, the literary magazine started by Cyril Connolly in 1940, and that I eventually did get a scholarship to Oxford I put down to the smattering of culture I gleaned from its pages.

In my day, it was a predominantly male institution with the main tables dividing themselves almost on religious or ethnic lines. There was a Catholic table, patronised by boys from St Michael’s College, the leading Catholic school, with blazers in bright Mary blue; there was a Jewish table where the boys came from Roundhay or the Grammar School, the Jewish boys even when they were not at the same school often knowing each other from the synagogue or other extra-curricular activities. If, like me, you were at the Modern School – and there were about half a dozen of us who were there regularly – you had no particular religious or racial affinities and indeed were not thought perhaps quite as clever, the school certainly not as good as Roundhay or the Grammar School. The few girls who braved this male citadel disrupted the formal division, leavened it, I’m sure for the better. And they worked harder than the boys and were seldom to be found on the landing outside where one adjourned for a smoke.

It had glamour, too, for me and getting in first at nine one morning I felt, opening my books, as I had when a small boy at Armley Baths and I had been first in there, the one to whom it fell to break the immaculate stillness of the water, shatter the straight lines tiled on the bottom of the bath and set the day on its way.

Of the boys who worked in the reference library a surprising number must have turned out to be lawyers, and I can count at least eight of my contemporaries who sat at those tables in the 1950s who became judges. A school – and certainly a state or provincial school – would consider that something to boast about, but libraries are facilities; a library has no honours board and takes no credit for what its readers go on to do but, remembering myself at 19, on leave from the army and calling up the copies of Horizon to get me through the general paper in the Oxford scholarship, I feel as much a debt to that library as I do to my school. It was a good library and though like everywhere else busier now than it was in my day, remains, unlike so much of Leeds, largely unaltered.

The library closed at nine and coming down in the lift (bevelled mirrors, mahogany panelling, little bench) the attendant, another British Legion figure, would stop and draw the gates at the floor below and in would get a covey of policemen and even the occasional miscreant en route for the cells. One of the policemen might be my cousin Arnold, who belonged to what my mother always felt was the slightly common wing of the Bennett family. Loud, burly and wonderfully genial, Arnold was a police photographer and he would regale me with the details of the latest murder he had been called on to snap: ‘By, Alan, I’ve seen some stuff.’ The stuff he’d seen included the corpse of the stripper Mary Millington, who had committed suicide. ‘I can’t understand why she committed suicide. She had a lovely body.’

To someone as prone to embarrassment as I was, these encounters, particularly in the presence of my schoolfriends, ought to have been shaming. That they never were was, I suppose, because Cousin Arnold was looked on as a creature from the real world, the world of prostitutes found dead on waste ground, corpses in copses and cars burned out down Lovers’ Lane. This was Life where I knew even then that I was not likely to be headed or ever to have much to do with.

There is no shortage of libraries in Oxford, some of them, of course, of great grandeur and beauty. The Radcliffe Camera seems to me one of the handsomest buildings in England and the square in which it stands a superb combination of styles. Crossing it on a moonlit winter’s night lifted the heart, though that was often the trouble with Oxford – the architecture out-soared one’s feelings, the sublime not always easy to match. There are in that one square three libraries, the Bodleian on the north side, on the east the Codrington, part of Hawksmoor’s All Souls, and James Gibbs’s Camera in the middle. There is actually another more modest library, neo-Gothic in style, and built by George Gilbert Scott in 1856. It’s over Exeter’s garden wall in the north-west corner of Radcliffe Square, but you can’t quite see that. This was where I worked, though it was possible if one was so inclined to get to study in the much more exclusive and architecturally splendid surroundings of the Codrington, and a few undergraduates did so. They tended, though, to set less store on what they were writing than on where they were writing it and I, with my narrow sympathies but who was just as foolish, despised them for it.

Staying on at Oxford after I’d taken my degree I did research in medieval history, the subject of my research Richard II’s retinue in the last ten years of his reign. This took me twice a week to the Public Record Office then still in Chancery Lane and in particular to the Round Room, galleried, lined with books, a humbler version of the much grander Round Room in the British Museum. Presiding over the BM Round Room in his early days was Angus Wilson whereas at the PRO it was Noel Blakiston, friend of Cyril Connolly, hair as white as Wilson’s and possibly the most distinguished-looking man I’ve ever seen.

Though I made copious notes on the manuscripts I studied (which were chiefly records of the medieval exchequer) I would have found it hard to say what it was I was looking for – imagining, I think, that having amassed sufficient material it would all suddenly fall into place and become clear. Failing that, I hoped to come upon some startling and unexpected fact, a very silly notion. Had it been Richard III I was researching rather than Richard II, it might have been something as relatively unambiguous as a note in the monarch’s own hand saying: ‘It was me that killed ye Princes in ye Tower, hee hee.’ Historical research nowadays is a dull business: had I any sense I would have been collating the tax returns of the knights I was studying or the amount they borrowed or were owed, or sifting through material other historians had ignored or discarded; it is seldom at the frontier that discoveries are made but more often in the dustbin.

The Memoranda Rolls on which I spent much of my time were long thin swatches of parchment about five feet long and one foot wide and written on both sides. Thus to turn the page required the co-operation and forbearance of most of the other readers at the table, and what would sometimes look like the cast of the Mad Hatter’s tea party struggling to put wallpaper up was just me trying to turn over. A side effect of reading these unwieldy documents was that one was straightaway propelled into quite an intimate relationship with readers alongside and among those I got to know in this way was the historian Cecil Woodham-Smith.

The author of The Great Hunger, an account of the Irish Famine, and The Reason Why, about the events leading up to the Charge of the Light Brigade, Cecil was a frail woman with a tiny bird-like skull, looking more like Elizabeth I (in later life) than Edith Sitwell ever did (and minus her sheet metal earrings). Irish, she had a Firbankian wit and a lovely turn of phrase. ‘Do you know the Atlantic at all?’ she once asked me and I put the line into Habeas Corpus and got a big laugh on it. From a grand Irish family she was quite snobbish; talking of someone she said: ‘Then he married a Mitford … but that’s a stage everybody goes through.’ Even the most ordinary remark would be given her own particular twist and she could be quite camp. Conversation had once turned, as conversations will, to fork-lift trucks. Feeling that industrial machinery might be remote from Cecil’s sphere of interest I said: ‘Do you know what a fork-lift truck is?’ She looked at me in her best Annie Walker manner. ‘I do. To my cost.’

Books and bookcases cropping up in stuff that I’ve written means that they have to be reproduced on stage or on film. This isn’t as straightforward as it might seem. A designer will either present you with shelves lined with gilt-tooled library sets, the sort of clubland books one can rent by the yard as decor, or he or she will send out for some junk books from the nearest second-hand bookshop and think that those will do. Another short cut is to order in a cargo of remaindered books so that you end up with a shelf so garish and lacking in character it bears about as much of a relationship to literature as a caravan site does to architecture. A bookshelf is as particular to its owner as are his or her clothes; a personality is stamped on a library just as a shoe is shaped by the foot.

That someone’s working library has a particular tone, with some shelves more heterogeneous than others, for example, or (in the case of an art historian) filled with offprints and monographs or (with an old-fashioned literary figure for instance) lined with the faded covers and jackets of distinctive Faber or Cape editions, does not seem to occur to a designer. On several occasions I’ve had to bring my own books down to the theatre to give the right worn tone to the shelves.

In The Old Country (1977) the books (Auden, Spender, MacNeice) are of central importance to the plot. I wanted their faded buffs and blues and yellows bleached into a unity of tone that suggested long sunlit Cambridge afternoons, the kind of books you might find lining Dadie Rylands’s rooms, for instance. Anthony Blunt’s bookshelves were crucial in Single Spies, the look of an art historian’s bookshelves significantly different from those of a literary critic say. All this tends to pass the designer by. One knows that designers seldom read, but they don’t have much knowledge of Inca civilisation either or the Puritan settlement of New England and yet they seem to cope perfectly well reproducing them. An agglomeration of books as illustrating the character of their owner seems to defeat them.

When I first bought books for myself in the late 1940s they were still thought to be quite precious and in poor homes books might often be backed in brown paper. Paper itself was in short supply and such new books as there were often bore the imprint ‘Produced in conformity with the Authorised Economy Standard’. The paper was mealy, slightly freckled and looked not unlike the texture of the ice cream of the period. It was, though, a notable period in book design and perhaps because they were among the first books I ever bought (one was C.V. Wedgwood’s William the Silent) the books of that time have always seemed to me all that was necessary or desirable – simple, unfussy, wholesome and well designed.

They were not, though, to be left about at home. ‘Books Do Furnish a Room’, wrote Anthony Powell, but my mother never thought so and she’d always put them out of the way in the sideboard when you weren’t looking. Books untidy, books upset, more her view. Though once a keen reader herself, particularly when she was younger, she always thought of library books as grubby and with a potential for infection – not intellectual infection either. Lurking among the municipally owned pages might be the germs of TB or scarlet fever, so one must never be seen to peer at a library book too closely or lick your finger before turning over still less read such a book in bed.

There were other perils to reading, but it was only when I hit middle age that I became aware of them. Me, I’m Afraid of Virginia Woolf was a television play written in 1978 and though it doesn’t contain my usual scene of someone baffled at a bookcase the sense of being outfaced by books is a good description of what the play is about. ‘Hopkins,’ I wrote of the middle-aged lecturer who is the hero, ‘Hopkins was never without a book. It wasn’t that he was particularly fond of reading; he just liked to have somewhere to look. A book makes you safe. Shows you’re not out to pick anybody up. Try it on. With a book you’re harmless. Though Hopkins was harmless without a book.’ Books as badges, books as shields; one doesn’t think of libraries as perilous places where you can come to harm. Still, they do carry their own risks.

I have been discussing libraries as places and in the current struggle to preserve public libraries not enough stress has been laid on the library as a place not just a facility. To a child living in high flats, say, where space is at a premium and peace and quiet not always easy to find, a library is a haven. But, saying that, a library needs to be handy and local; it shouldn’t require an expedition. Municipal authorities of all parties point to splendid new and scheduled central libraries as if this discharges them of their obligations. It doesn’t. For a child a library needs to be round the corner. And if we lose local libraries it is children who will suffer. Of the libraries I have mentioned the most important for me was that first one, the dark and unprepossessing Armley Junior Library. I had just learned to read. I needed books. Add computers to that requirement maybe but a child from a poor family is today in exactly the same boat.

The business of closing libraries isn’t a straightforward political fight. The local authorities shelter behind the demands of central government which in its turn pretends that local councils have a choice. It’s shaming that, regardless of the party’s proud tradition of popular education, Labour municipalities are not making more of a stand. For the Tories privatising the libraries has been on the agenda for far longer than they would currently like to admit. This is an extract from my diary:

22 February Switch on Newsnight to find some bright spark from, guess where, the Adam Smith Institute, proposing the privatisation of the public libraries. His name is Eamonn Butler and it’s to be hoped he’s no relation of the 1944 Education Act Butler. Smirking and pleased with himself as they generally are from that stable, he’s pitted against a well-meaning but flustered woman who’s an authority on children’s books. Paxman looks on undissenting as this odious figure dismisses any defence of the tradition of free public libraries as ‘the usual bleating of the middle classes’. I go to bed depressed only to wake and find Madsen Pirie, also from the Adam Smith Institute for the Criminally Insane, banging the same drum in the Independent. Not long ago John Bird and John Fortune did a sketch about the privatisation of air. These days it scarcely seems unthinkable.

That was written in 1996. It’s hard not to think that like other Tory policies privatising the libraries has been lying dormant for 15 years, just waiting for a convenient crisis to smuggle it through. Libraries are, after all, as another think tank clown opined a few weeks ago, ‘a valuable retail outlet’.